PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - Zend - zend_vm_execute.h (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 9374 16806 55.8 %
Date: 2015-09-02 Functions: 584 992 58.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | Zend Engine                                                          |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 2.00 of the Zend license,     |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.zend.com/license/2_00.txt.                                |
      11             :    | If you did not receive a copy of the Zend license and are unable to  |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@zend.com so we can mail you a copy immediately.              |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Andi Gutmans <andi@zend.com>                                |
      16             :    |          Zeev Suraski <zeev@zend.com>                                |
      17             :    |          Dmitry Stogov <dmitry@zend.com>                             |
      18             :    +----------------------------------------------------------------------+
      19             : */
      20             : 
      21             : #ifdef ZEND_WIN32
      22             : # pragma warning(once : 4101)
      23             : # pragma warning(once : 6235)
      24             : # pragma warning(once : 6237)
      25             : # pragma warning(once : 6239)
      26             : # pragma warning(once : 6240)
      27             : # pragma warning(once : 6285)
      28             : # pragma warning(once : 6286)
      29             : # pragma warning(once : 6326)
      30             : #endif
      31             : static user_opcode_handler_t zend_user_opcode_handlers[256] = {
      32             :         (user_opcode_handler_t)NULL,
      33             :         (user_opcode_handler_t)NULL,
      34             :         (user_opcode_handler_t)NULL,
      35             :         (user_opcode_handler_t)NULL,
      36             :         (user_opcode_handler_t)NULL,
      37             :         (user_opcode_handler_t)NULL,
      38             :         (user_opcode_handler_t)NULL,
      39             :         (user_opcode_handler_t)NULL,
      40             :         (user_opcode_handler_t)NULL,
      41             :         (user_opcode_handler_t)NULL,
      42             :         (user_opcode_handler_t)NULL,
      43             :         (user_opcode_handler_t)NULL,
      44             :         (user_opcode_handler_t)NULL,
      45             :         (user_opcode_handler_t)NULL,
      46             :         (user_opcode_handler_t)NULL,
      47             :         (user_opcode_handler_t)NULL,
      48             :         (user_opcode_handler_t)NULL,
      49             :         (user_opcode_handler_t)NULL,
      50             :         (user_opcode_handler_t)NULL,
      51             :         (user_opcode_handler_t)NULL,
      52             :         (user_opcode_handler_t)NULL,
      53             :         (user_opcode_handler_t)NULL,
      54             :         (user_opcode_handler_t)NULL,
      55             :         (user_opcode_handler_t)NULL,
      56             :         (user_opcode_handler_t)NULL,
      57             :         (user_opcode_handler_t)NULL,
      58             :         (user_opcode_handler_t)NULL,
      59             :         (user_opcode_handler_t)NULL,
      60             :         (user_opcode_handler_t)NULL,
      61             :         (user_opcode_handler_t)NULL,
      62             :         (user_opcode_handler_t)NULL,
      63             :         (user_opcode_handler_t)NULL,
      64             :         (user_opcode_handler_t)NULL,
      65             :         (user_opcode_handler_t)NULL,
      66             :         (user_opcode_handler_t)NULL,
      67             :         (user_opcode_handler_t)NULL,
      68             :         (user_opcode_handler_t)NULL,
      69             :         (user_opcode_handler_t)NULL,
      70             :         (user_opcode_handler_t)NULL,
      71             :         (user_opcode_handler_t)NULL,
      72             :         (user_opcode_handler_t)NULL,
      73             :         (user_opcode_handler_t)NULL,
      74             :         (user_opcode_handler_t)NULL,
      75             :         (user_opcode_handler_t)NULL,
      76             :         (user_opcode_handler_t)NULL,
      77             :         (user_opcode_handler_t)NULL,
      78             :         (user_opcode_handler_t)NULL,
      79             :         (user_opcode_handler_t)NULL,
      80             :         (user_opcode_handler_t)NULL,
      81             :         (user_opcode_handler_t)NULL,
      82             :         (user_opcode_handler_t)NULL,
      83             :         (user_opcode_handler_t)NULL,
      84             :         (user_opcode_handler_t)NULL,
      85             :         (user_opcode_handler_t)NULL,
      86             :         (user_opcode_handler_t)NULL,
      87             :         (user_opcode_handler_t)NULL,
      88             :         (user_opcode_handler_t)NULL,
      89             :         (user_opcode_handler_t)NULL,
      90             :         (user_opcode_handler_t)NULL,
      91             :         (user_opcode_handler_t)NULL,
      92             :         (user_opcode_handler_t)NULL,
      93             :         (user_opcode_handler_t)NULL,
      94             :         (user_opcode_handler_t)NULL,
      95             :         (user_opcode_handler_t)NULL,
      96             :         (user_opcode_handler_t)NULL,
      97             :         (user_opcode_handler_t)NULL,
      98             :         (user_opcode_handler_t)NULL,
      99             :         (user_opcode_handler_t)NULL,
     100             :         (user_opcode_handler_t)NULL,
     101             :         (user_opcode_handler_t)NULL,
     102             :         (user_opcode_handler_t)NULL,
     103             :         (user_opcode_handler_t)NULL,
     104             :         (user_opcode_handler_t)NULL,
     105             :         (user_opcode_handler_t)NULL,
     106             :         (user_opcode_handler_t)NULL,
     107             :         (user_opcode_handler_t)NULL,
     108             :         (user_opcode_handler_t)NULL,
     109             :         (user_opcode_handler_t)NULL,
     110             :         (user_opcode_handler_t)NULL,
     111             :         (user_opcode_handler_t)NULL,
     112             :         (user_opcode_handler_t)NULL,
     113             :         (user_opcode_handler_t)NULL,
     114             :         (user_opcode_handler_t)NULL,
     115             :         (user_opcode_handler_t)NULL,
     116             :         (user_opcode_handler_t)NULL,
     117             :         (user_opcode_handler_t)NULL,
     118             :         (user_opcode_handler_t)NULL,
     119             :         (user_opcode_handler_t)NULL,
     120             :         (user_opcode_handler_t)NULL,
     121             :         (user_opcode_handler_t)NULL,
     122             :         (user_opcode_handler_t)NULL,
     123             :         (user_opcode_handler_t)NULL,
     124             :         (user_opcode_handler_t)NULL,
     125             :         (user_opcode_handler_t)NULL,
     126             :         (user_opcode_handler_t)NULL,
     127             :         (user_opcode_handler_t)NULL,
     128             :         (user_opcode_handler_t)NULL,
     129             :         (user_opcode_handler_t)NULL,
     130             :         (user_opcode_handler_t)NULL,
     131             :         (user_opcode_handler_t)NULL,
     132             :         (user_opcode_handler_t)NULL,
     133             :         (user_opcode_handler_t)NULL,
     134             :         (user_opcode_handler_t)NULL,
     135             :         (user_opcode_handler_t)NULL,
     136             :         (user_opcode_handler_t)NULL,
     137             :         (user_opcode_handler_t)NULL,
     138             :         (user_opcode_handler_t)NULL,
     139             :         (user_opcode_handler_t)NULL,
     140             :         (user_opcode_handler_t)NULL,
     141             :         (user_opcode_handler_t)NULL,
     142             :         (user_opcode_handler_t)NULL,
     143             :         (user_opcode_handler_t)NULL,
     144             :         (user_opcode_handler_t)NULL,
     145             :         (user_opcode_handler_t)NULL,
     146             :         (user_opcode_handler_t)NULL,
     147             :         (user_opcode_handler_t)NULL,
     148             :         (user_opcode_handler_t)NULL,
     149             :         (user_opcode_handler_t)NULL,
     150             :         (user_opcode_handler_t)NULL,
     151             :         (user_opcode_handler_t)NULL,
     152             :         (user_opcode_handler_t)NULL,
     153             :         (user_opcode_handler_t)NULL,
     154             :         (user_opcode_handler_t)NULL,
     155             :         (user_opcode_handler_t)NULL,
     156             :         (user_opcode_handler_t)NULL,
     157             :         (user_opcode_handler_t)NULL,
     158             :         (user_opcode_handler_t)NULL,
     159             :         (user_opcode_handler_t)NULL,
     160             :         (user_opcode_handler_t)NULL,
     161             :         (user_opcode_handler_t)NULL,
     162             :         (user_opcode_handler_t)NULL,
     163             :         (user_opcode_handler_t)NULL,
     164             :         (user_opcode_handler_t)NULL,
     165             :         (user_opcode_handler_t)NULL,
     166             :         (user_opcode_handler_t)NULL,
     167             :         (user_opcode_handler_t)NULL,
     168             :         (user_opcode_handler_t)NULL,
     169             :         (user_opcode_handler_t)NULL,
     170             :         (user_opcode_handler_t)NULL,
     171             :         (user_opcode_handler_t)NULL,
     172             :         (user_opcode_handler_t)NULL,
     173             :         (user_opcode_handler_t)NULL,
     174             :         (user_opcode_handler_t)NULL,
     175             :         (user_opcode_handler_t)NULL,
     176             :         (user_opcode_handler_t)NULL,
     177             :         (user_opcode_handler_t)NULL,
     178             :         (user_opcode_handler_t)NULL,
     179             :         (user_opcode_handler_t)NULL,
     180             :         (user_opcode_handler_t)NULL,
     181             :         (user_opcode_handler_t)NULL,
     182             :         (user_opcode_handler_t)NULL,
     183             :         (user_opcode_handler_t)NULL,
     184             :         (user_opcode_handler_t)NULL,
     185             :         (user_opcode_handler_t)NULL,
     186             :         (user_opcode_handler_t)NULL,
     187             :         (user_opcode_handler_t)NULL,
     188             :         (user_opcode_handler_t)NULL,
     189             :         (user_opcode_handler_t)NULL,
     190             :         (user_opcode_handler_t)NULL,
     191             :         (user_opcode_handler_t)NULL,
     192             :         (user_opcode_handler_t)NULL,
     193             :         (user_opcode_handler_t)NULL,
     194             :         (user_opcode_handler_t)NULL,
     195             :         (user_opcode_handler_t)NULL,
     196             :         (user_opcode_handler_t)NULL,
     197             :         (user_opcode_handler_t)NULL,
     198             :         (user_opcode_handler_t)NULL,
     199             :         (user_opcode_handler_t)NULL,
     200             :         (user_opcode_handler_t)NULL,
     201             :         (user_opcode_handler_t)NULL,
     202             :         (user_opcode_handler_t)NULL,
     203             :         (user_opcode_handler_t)NULL,
     204             :         (user_opcode_handler_t)NULL,
     205             :         (user_opcode_handler_t)NULL,
     206             :         (user_opcode_handler_t)NULL,
     207             :         (user_opcode_handler_t)NULL,
     208             :         (user_opcode_handler_t)NULL,
     209             :         (user_opcode_handler_t)NULL,
     210             :         (user_opcode_handler_t)NULL,
     211             :         (user_opcode_handler_t)NULL,
     212             :         (user_opcode_handler_t)NULL,
     213             :         (user_opcode_handler_t)NULL,
     214             :         (user_opcode_handler_t)NULL,
     215             :         (user_opcode_handler_t)NULL,
     216             :         (user_opcode_handler_t)NULL,
     217             :         (user_opcode_handler_t)NULL,
     218             :         (user_opcode_handler_t)NULL,
     219             :         (user_opcode_handler_t)NULL,
     220             :         (user_opcode_handler_t)NULL,
     221             :         (user_opcode_handler_t)NULL,
     222             :         (user_opcode_handler_t)NULL,
     223             :         (user_opcode_handler_t)NULL,
     224             :         (user_opcode_handler_t)NULL,
     225             :         (user_opcode_handler_t)NULL,
     226             :         (user_opcode_handler_t)NULL,
     227             :         (user_opcode_handler_t)NULL,
     228             :         (user_opcode_handler_t)NULL,
     229             :         (user_opcode_handler_t)NULL,
     230             :         (user_opcode_handler_t)NULL,
     231             :         (user_opcode_handler_t)NULL,
     232             :         (user_opcode_handler_t)NULL,
     233             :         (user_opcode_handler_t)NULL,
     234             :         (user_opcode_handler_t)NULL,
     235             :         (user_opcode_handler_t)NULL,
     236             :         (user_opcode_handler_t)NULL,
     237             :         (user_opcode_handler_t)NULL,
     238             :         (user_opcode_handler_t)NULL,
     239             :         (user_opcode_handler_t)NULL,
     240             :         (user_opcode_handler_t)NULL,
     241             :         (user_opcode_handler_t)NULL,
     242             :         (user_opcode_handler_t)NULL,
     243             :         (user_opcode_handler_t)NULL,
     244             :         (user_opcode_handler_t)NULL,
     245             :         (user_opcode_handler_t)NULL,
     246             :         (user_opcode_handler_t)NULL,
     247             :         (user_opcode_handler_t)NULL,
     248             :         (user_opcode_handler_t)NULL,
     249             :         (user_opcode_handler_t)NULL,
     250             :         (user_opcode_handler_t)NULL,
     251             :         (user_opcode_handler_t)NULL,
     252             :         (user_opcode_handler_t)NULL,
     253             :         (user_opcode_handler_t)NULL,
     254             :         (user_opcode_handler_t)NULL,
     255             :         (user_opcode_handler_t)NULL,
     256             :         (user_opcode_handler_t)NULL,
     257             :         (user_opcode_handler_t)NULL,
     258             :         (user_opcode_handler_t)NULL,
     259             :         (user_opcode_handler_t)NULL,
     260             :         (user_opcode_handler_t)NULL,
     261             :         (user_opcode_handler_t)NULL,
     262             :         (user_opcode_handler_t)NULL,
     263             :         (user_opcode_handler_t)NULL,
     264             :         (user_opcode_handler_t)NULL,
     265             :         (user_opcode_handler_t)NULL,
     266             :         (user_opcode_handler_t)NULL,
     267             :         (user_opcode_handler_t)NULL,
     268             :         (user_opcode_handler_t)NULL,
     269             :         (user_opcode_handler_t)NULL,
     270             :         (user_opcode_handler_t)NULL,
     271             :         (user_opcode_handler_t)NULL,
     272             :         (user_opcode_handler_t)NULL,
     273             :         (user_opcode_handler_t)NULL,
     274             :         (user_opcode_handler_t)NULL,
     275             :         (user_opcode_handler_t)NULL,
     276             :         (user_opcode_handler_t)NULL,
     277             :         (user_opcode_handler_t)NULL,
     278             :         (user_opcode_handler_t)NULL,
     279             :         (user_opcode_handler_t)NULL,
     280             :         (user_opcode_handler_t)NULL,
     281             :         (user_opcode_handler_t)NULL,
     282             :         (user_opcode_handler_t)NULL,
     283             :         (user_opcode_handler_t)NULL,
     284             :         (user_opcode_handler_t)NULL,
     285             :         (user_opcode_handler_t)NULL,
     286             :         (user_opcode_handler_t)NULL,
     287             :         (user_opcode_handler_t)NULL
     288             : };
     289             : 
     290             : static zend_uchar zend_user_opcodes[256] = {0,
     291             :         1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
     292             :         17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,
     293             :         33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,
     294             :         49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,
     295             :         65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,
     296             :         81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,
     297             :         97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
     298             :         113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,
     299             :         129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,
     300             :         145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,
     301             :         161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,
     302             :         177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,
     303             :         193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,
     304             :         209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,
     305             :         225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,
     306             :         241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
     307             : };
     308             : 
     309             : static const void **zend_opcode_handlers;
     310             : static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);
     311             : 
     312             : 
     313             : #ifdef ZEND_VM_FP_GLOBAL_REG
     314             : register zend_execute_data* volatile execute_data __asm__(ZEND_VM_FP_GLOBAL_REG);
     315             : #endif
     316             : 
     317             : #ifdef ZEND_VM_IP_GLOBAL_REG
     318             : register const zend_op* volatile opline __asm__(ZEND_VM_IP_GLOBAL_REG);
     319             : #endif
     320             : 
     321             : #ifdef ZEND_VM_FP_GLOBAL_REG
     322             : # define ZEND_OPCODE_HANDLER_ARGS void
     323             : # define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU
     324             : # define ZEND_OPCODE_HANDLER_ARGS_DC
     325             : # define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC
     326             : #else
     327             : # define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data
     328             : # define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data
     329             : # define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS
     330             : # define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU
     331             : #endif
     332             : 
     333             : #if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
     334             : # define ZEND_OPCODE_HANDLER_RET void
     335             : # define ZEND_VM_TAIL_CALL(call) call; return
     336             : # define ZEND_VM_CONTINUE()      return
     337             : # define ZEND_VM_RETURN()        opline = NULL; ZEND_VM_CONTINUE()
     338             : #else
     339             : # define ZEND_OPCODE_HANDLER_RET int
     340             : # define ZEND_VM_TAIL_CALL(call) return call
     341             : # define ZEND_VM_CONTINUE()      return  0
     342             : # define ZEND_VM_RETURN()        return -1
     343             : #endif
     344             : 
     345             : typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARGS);
     346             : 
     347             : #undef OPLINE
     348             : #undef DCL_OPLINE
     349             : #undef USE_OPLINE
     350             : #undef LOAD_OPLINE
     351             : #undef LOAD_OPLINE_EX
     352             : #undef SAVE_OPLINE
     353             : #define DCL_OPLINE
     354             : #ifdef ZEND_VM_IP_GLOBAL_REG
     355             : # define OPLINE opline
     356             : # define USE_OPLINE
     357             : # define LOAD_OPLINE() opline = EX(opline)
     358             : # define LOAD_NEXT_OPLINE() opline = EX(opline) + 1
     359             : # define SAVE_OPLINE() EX(opline) = opline
     360             : #else
     361             : # define OPLINE EX(opline)
     362             : # define USE_OPLINE const zend_op *opline = EX(opline);
     363             : # define LOAD_OPLINE()
     364             : # define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()
     365             : # define SAVE_OPLINE()
     366             : #endif
     367             : #undef HANDLE_EXCEPTION
     368             : #undef HANDLE_EXCEPTION_LEAVE
     369             : #define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()
     370             : #define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()
     371             : #if defined(ZEND_VM_FP_GLOBAL_REG)
     372             : # define ZEND_VM_ENTER()           execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM_CONTINUE()
     373             : # define ZEND_VM_LEAVE()           ZEND_VM_CONTINUE()
     374             : #elif defined(ZEND_VM_IP_GLOBAL_REG)
     375             : # define ZEND_VM_ENTER()           opline = EG(current_execute_data)->opline; return 1
     376             : # define ZEND_VM_LEAVE()           return  2
     377             : #else
     378             : # define ZEND_VM_ENTER()           return  1
     379             : # define ZEND_VM_LEAVE()           return  2
     380             : #endif
     381             : #define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_opcode_handler(opcode, opline))(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
     382             : 
     383             : 
     384     2923429 : ZEND_API void execute_ex(zend_execute_data *ex)
     385             : {
     386             :         DCL_OPLINE
     387             : 
     388             : #ifdef ZEND_VM_IP_GLOBAL_REG
     389             :         const zend_op *orig_opline = opline;
     390             : #endif
     391             : #ifdef ZEND_VM_FP_GLOBAL_REG
     392             :         zend_execute_data *orig_execute_data = execute_data;
     393             :         execute_data = ex;
     394             : #else
     395     2923429 :         zend_execute_data *execute_data = ex;
     396             : #endif
     397             : 
     398             : 
     399             :         LOAD_OPLINE();
     400             : 
     401             :         while (1) {
     402             : #if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)
     403             :         int ret;
     404             : #endif
     405             : #if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)
     406             :                 ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
     407             :                 if (UNEXPECTED(!OPLINE)) {
     408             : #else
     409   226695482 :                 if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0)) {
     410             : #endif
     411             : #ifdef ZEND_VM_FP_GLOBAL_REG
     412             :                         execute_data = orig_execute_data;
     413             : # ifdef ZEND_VM_IP_GLOBAL_REG
     414             :                         opline = orig_opline;
     415             : # endif
     416             :                         return;
     417             : #else
     418     5489177 :                         if (EXPECTED(ret > 0)) {
     419     2567029 :                                 execute_data = EG(current_execute_data);
     420             :                         } else {
     421             : # ifdef ZEND_VM_IP_GLOBAL_REG
     422             :                                 opline = orig_opline;
     423             : # endif
     424     2922148 :                                 return;
     425             :                         }
     426             : #endif
     427             :                 }
     428             : 
     429   223772053 :         }
     430             :         zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen");
     431             : }
     432             : 
     433       21111 : ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value)
     434             : {
     435             :         zend_execute_data *execute_data;
     436             : 
     437       21111 :         if (EG(exception) != NULL) {
     438           0 :                 return;
     439             :         }
     440             : 
     441       63333 :         execute_data = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_CODE,
     442       42222 :                 (zend_function*)op_array, 0, zend_get_called_scope(EG(current_execute_data)), zend_get_this_object(EG(current_execute_data)));
     443       21111 :         if (EG(current_execute_data)) {
     444         152 :                 execute_data->symbol_table = zend_rebuild_symbol_table();
     445             :         } else {
     446       20959 :                 execute_data->symbol_table = &EG(symbol_table);
     447             :         }
     448       21111 :         EX(prev_execute_data) = EG(current_execute_data);
     449             :         i_init_execute_data(execute_data, op_array, return_value);
     450       21111 :         zend_execute_ex(execute_data);
     451             :         zend_vm_stack_free_call_frame(execute_data);
     452             : }
     453             : 
     454     1754158 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
     455             : {
     456             :         zend_execute_data *old_execute_data;
     457     1754158 :         uint32_t call_info = EX_CALL_INFO();
     458             : 
     459     1754158 :         if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_NESTED_FUNCTION) {
     460             :                 zend_object *object;
     461             : 
     462             :                 i_free_compiled_variables(execute_data);
     463     1274231 :                 if (UNEXPECTED(EX(symbol_table) != NULL)) {
     464       87769 :                         zend_clean_and_cache_symbol_table(EX(symbol_table));
     465             :                 }
     466             :                 zend_vm_stack_free_extra_args_ex(call_info, execute_data);
     467     1274231 :                 old_execute_data = execute_data;
     468     1274231 :                 execute_data = EG(current_execute_data) = EX(prev_execute_data);
     469     1274231 :                 if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
     470         513 :                         OBJ_RELEASE((zend_object*)old_execute_data->func->op_array.prototype);
     471             :                 }
     472     1274231 :                 if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
     473      100387 :                         object = Z_OBJ(old_execute_data->This);
     474             : #if 0
     475             :                         if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) {
     476             :                                 if (!(EX(opline)->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) {
     477             : #else
     478      100387 :                         if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
     479          34 :                                 if (!(call_info & ZEND_CALL_CTOR_RESULT_UNUSED)) {
     480             : #endif
     481          22 :                                         GC_REFCOUNT(object)--;
     482             :                                 }
     483          34 :                                 if (GC_REFCOUNT(object) == 1) {
     484          33 :                                         zend_object_store_ctor_failed(object);
     485             :                                 }
     486             :                         }
     487             :                         OBJ_RELEASE(object);
     488             :                 }
     489     1274231 :                 EG(scope) = EX(func)->op_array.scope;
     490             : 
     491             :                 zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
     492             : 
     493     1274231 :                 if (UNEXPECTED(EG(exception) != NULL)) {
     494         467 :                         const zend_op *old_opline = EX(opline);
     495         467 :                         zend_throw_exception_internal(NULL);
     496         467 :                         if (RETURN_VALUE_USED(old_opline)) {
     497         198 :                                 zval_ptr_dtor(EX_VAR(old_opline->result.var));
     498             :                         }
     499         467 :                         HANDLE_EXCEPTION_LEAVE();
     500             :                 }
     501             : 
     502     1273764 :                 LOAD_NEXT_OPLINE();
     503     1273764 :                 ZEND_VM_LEAVE();
     504      479927 :         } else if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_NESTED_CODE) {
     505        8820 :                 zend_detach_symbol_table(execute_data);
     506        8820 :                 destroy_op_array(&EX(func)->op_array);
     507        8820 :                 efree_size(EX(func), sizeof(zend_op_array));
     508        8820 :                 old_execute_data = execute_data;
     509        8820 :                 execute_data = EG(current_execute_data) = EX(prev_execute_data);
     510             :                 zend_vm_stack_free_call_frame_ex(call_info, old_execute_data);
     511             : 
     512        8820 :                 zend_attach_symbol_table(execute_data);
     513        8820 :                 if (UNEXPECTED(EG(exception) != NULL)) {
     514          24 :                         zend_throw_exception_internal(NULL);
     515          24 :                         HANDLE_EXCEPTION_LEAVE();
     516             :                 }
     517             : 
     518        8796 :                 LOAD_NEXT_OPLINE();
     519        8796 :                 ZEND_VM_LEAVE();
     520             :         } else {
     521      471107 :                 if (ZEND_CALL_KIND_EX(call_info) == ZEND_CALL_TOP_FUNCTION) {
     522             :                         i_free_compiled_variables(execute_data);
     523      451239 :                         if (UNEXPECTED(EX(symbol_table) != NULL)) {
     524          75 :                                 zend_clean_and_cache_symbol_table(EX(symbol_table));
     525             :                         }
     526             :                         zend_vm_stack_free_extra_args_ex(call_info, execute_data);
     527      451239 :                         EG(current_execute_data) = EX(prev_execute_data);
     528      451239 :                         if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
     529         438 :                                 OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
     530             :                         }
     531             :                 } else /* if (call_kind == ZEND_CALL_TOP_CODE) */ {
     532       19868 :                         zend_array *symbol_table = EX(symbol_table);
     533             : 
     534       19868 :                         zend_detach_symbol_table(execute_data);
     535       19868 :                         old_execute_data = EX(prev_execute_data);
     536       39892 :                         while (old_execute_data) {
     537         308 :                                 if (old_execute_data->func && ZEND_USER_CODE(old_execute_data->func->op_array.type)) {
     538         152 :                                         if (old_execute_data->symbol_table == symbol_table) {
     539         152 :                                                 zend_attach_symbol_table(old_execute_data);
     540             :                                         }
     541         152 :                                         break;
     542             :                                 }
     543         156 :                                 old_execute_data = old_execute_data->prev_execute_data;
     544             :                         }
     545       19868 :                         EG(current_execute_data) = EX(prev_execute_data);
     546             :                 }
     547             : 
     548      471107 :                 ZEND_VM_RETURN();
     549             :         }
     550             : }
     551             : 
     552     6458499 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
     553             : {
     554     6458499 :         USE_OPLINE
     555             : 
     556     6458499 :         ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op1));
     557     6458499 :         ZEND_VM_CONTINUE();
     558             : }
     559             : 
     560    22600940 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
     561             : {
     562    22600940 :         USE_OPLINE
     563    22600940 :         zend_execute_data *call = EX(call);
     564    22600940 :         zend_function *fbc = call->func;
     565             :         zval *ret;
     566             : 
     567             :         SAVE_OPLINE();
     568    22600940 :         EX(call) = call->prev_execute_data;
     569             : 
     570    22600940 :         call->prev_execute_data = execute_data;
     571    22600940 :         EG(current_execute_data) = call;
     572             : 
     573    22600940 :         ret = EX_VAR(opline->result.var);
     574    22600940 :         ZVAL_NULL(ret);
     575    22600940 :         Z_VAR_FLAGS_P(ret) = 0;
     576             : 
     577    22600940 :         fbc->internal_function.handler(call, ret);
     578             : 
     579             : #if ZEND_DEBUG
     580             :         ZEND_ASSERT(
     581             :                 !call->func ||
     582             :                 !(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
     583             :                 zend_verify_internal_return_type(call->func, EX_VAR(opline->result.var)));
     584             : #endif
     585             : 
     586    22600912 :         EG(current_execute_data) = call->prev_execute_data;
     587             :         zend_vm_stack_free_args(call);
     588             :         zend_vm_stack_free_call_frame(call);
     589             : 
     590    22600912 :         if (!RETURN_VALUE_USED(opline)) {
     591     1110533 :                 zval_ptr_dtor(EX_VAR(opline->result.var));
     592             :         }
     593             : 
     594    22600912 :         if (UNEXPECTED(EG(exception) != NULL)) {
     595         100 :                 zend_throw_exception_internal(NULL);
     596         100 :                 if (RETURN_VALUE_USED(opline)) {
     597          48 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
     598             :                 }
     599         100 :                 HANDLE_EXCEPTION();
     600             :         }
     601             : 
     602             :         ZEND_VM_INTERRUPT_CHECK();
     603    22600812 :         ZEND_VM_NEXT_OPCODE();
     604             : }
     605             : 
     606      889468 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
     607             : {
     608      889468 :         USE_OPLINE
     609      889468 :         zend_execute_data *call = EX(call);
     610      889468 :         zend_function *fbc = call->func;
     611             :         zval *ret;
     612             : 
     613             :         SAVE_OPLINE();
     614      889468 :         EX(call) = call->prev_execute_data;
     615             : 
     616      889468 :         EG(scope) = NULL;
     617      889468 :         ret = NULL;
     618      889468 :         call->symbol_table = NULL;
     619      889468 :         if (RETURN_VALUE_USED(opline)) {
     620      811215 :                 ret = EX_VAR(opline->result.var);
     621      811215 :                 ZVAL_NULL(ret);
     622      811215 :                 Z_VAR_FLAGS_P(ret) = 0;
     623             :         }
     624             : 
     625      889468 :         call->prev_execute_data = execute_data;
     626      889468 :         i_init_func_execute_data(call, &fbc->op_array, ret, 0);
     627             : 
     628      889468 :         ZEND_VM_ENTER();
     629             : }
     630             : 
     631      329638 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
     632             : {
     633      329638 :         USE_OPLINE
     634      329638 :         zend_execute_data *call = EX(call);
     635      329638 :         zend_function *fbc = call->func;
     636             :         zval *ret;
     637             : 
     638             :         SAVE_OPLINE();
     639      329638 :         EX(call) = call->prev_execute_data;
     640             : 
     641      329638 :         if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
     642      329334 :                 EG(scope) = NULL;
     643      329334 :                 if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
     644       50005 :                         if (EXPECTED(RETURN_VALUE_USED(opline))) {
     645       50005 :                                 ret = EX_VAR(opline->result.var);
     646       50005 :                                 zend_generator_create_zval(call, &fbc->op_array, ret);
     647       50005 :                                 Z_VAR_FLAGS_P(ret) = 0;
     648             :                         } else {
     649             :                                 zend_vm_stack_free_args(call);
     650             :                         }
     651             : 
     652             :                         zend_vm_stack_free_call_frame(call);
     653             :                 } else {
     654      279329 :                         ret = NULL;
     655      279329 :                         call->symbol_table = NULL;
     656      279329 :                         if (RETURN_VALUE_USED(opline)) {
     657      160811 :                                 ret = EX_VAR(opline->result.var);
     658      160811 :                                 ZVAL_NULL(ret);
     659      160811 :                                 Z_VAR_FLAGS_P(ret) = 0;
     660             :                         }
     661             : 
     662      279329 :                         call->prev_execute_data = execute_data;
     663      279329 :                         i_init_func_execute_data(call, &fbc->op_array, ret, 0);
     664             : 
     665      279329 :                         ZEND_VM_ENTER();
     666             :                 }
     667       50005 :                 EG(scope) = EX(func)->op_array.scope;
     668             :         } else {
     669             :                 ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION);
     670             : 
     671         304 :                 if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
     672           0 :                         zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
     673           0 :                                 fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
     674           0 :                                 fbc->common.scope ? "::" : "",
     675           0 :                                 ZSTR_VAL(fbc->common.function_name));
     676           0 :                         if (UNEXPECTED(EG(exception) != NULL)) {
     677           0 :                                 HANDLE_EXCEPTION();
     678             :                         }
     679             :                 }
     680             : 
     681         304 :                 call->prev_execute_data = execute_data;
     682         304 :                 EG(current_execute_data) = call;
     683             : 
     684         304 :                 if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
     685             :                         uint32_t i;
     686           0 :                         uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
     687           0 :                         zval *p = ZEND_CALL_ARG(call, 1);
     688             : 
     689           0 :                         for (i = 0; i < num_args; ++i) {
     690           0 :                                 zend_verify_internal_arg_type(fbc, i + 1, p);
     691           0 :                                 p++;
     692             :                         }
     693           0 :                         if (UNEXPECTED(EG(exception) != NULL)) {
     694           0 :                                 EG(current_execute_data) = call->prev_execute_data;
     695             :                                 zend_vm_stack_free_args(call);
     696             :                                 zend_vm_stack_free_call_frame(call);
     697           0 :                                 zend_throw_exception_internal(NULL);
     698           0 :                                 HANDLE_EXCEPTION();
     699             :                         }
     700             :                 }
     701             : 
     702         304 :                 ret = EX_VAR(opline->result.var);
     703         304 :                 ZVAL_NULL(ret);
     704         304 :                 Z_VAR_FLAGS_P(ret) = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0 ? IS_VAR_RET_REF : 0;
     705             : 
     706         304 :                 fbc->internal_function.handler(call, ret);
     707             : 
     708             : #if ZEND_DEBUG
     709             :                 ZEND_ASSERT(
     710             :                         !call->func ||
     711             :                         !(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
     712             :                         zend_verify_internal_return_type(call->func, EX_VAR(opline->result.var)));
     713             : #endif
     714             : 
     715         304 :                 EG(current_execute_data) = call->prev_execute_data;
     716             :                 zend_vm_stack_free_args(call);
     717             :                 zend_vm_stack_free_call_frame(call);
     718             : 
     719         304 :                 if (!RETURN_VALUE_USED(opline)) {
     720         242 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
     721             :                 }
     722             :         }
     723             : 
     724       50309 :         if (UNEXPECTED(EG(exception) != NULL)) {
     725           0 :                 zend_throw_exception_internal(NULL);
     726           0 :                 if (RETURN_VALUE_USED(opline)) {
     727           0 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
     728             :                 }
     729           0 :                 HANDLE_EXCEPTION();
     730             :         }
     731             :         ZEND_VM_INTERRUPT_CHECK();
     732       50309 :         ZEND_VM_NEXT_OPCODE();
     733             : }
     734             : 
     735     3078865 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
     736             : {
     737     3078865 :         USE_OPLINE
     738     3078865 :         zend_execute_data *call = EX(call);
     739     3078865 :         zend_function *fbc = call->func;
     740             :         zend_object *object;
     741             :         zval *ret;
     742             : 
     743             :         SAVE_OPLINE();
     744     3078865 :         EX(call) = call->prev_execute_data;
     745     3078865 :         if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) {
     746          12 :                 if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) {
     747           5 :                         zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
     748           5 :                         HANDLE_EXCEPTION();
     749             :                 }
     750           7 :                 if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) {
     751          21 :                         zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
     752           7 :                                 fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "",
     753           7 :                                 fbc->common.scope ? "::" : "",
     754           7 :                                 ZSTR_VAL(fbc->common.function_name));
     755           7 :                         if (UNEXPECTED(EG(exception) != NULL)) {
     756           0 :                                 HANDLE_EXCEPTION();
     757             :                         }
     758             :                 }
     759             :         }
     760             : 
     761             :         LOAD_OPLINE();
     762             : 
     763     3078860 :         if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
     764      106202 :                 EG(scope) = fbc->common.scope;
     765      106202 :                 if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
     766         391 :                         if (EXPECTED(RETURN_VALUE_USED(opline))) {
     767         389 :                                 ret = EX_VAR(opline->result.var);
     768         389 :                                 zend_generator_create_zval(call, &fbc->op_array, ret);
     769         389 :                                 Z_VAR_FLAGS_P(ret) = 0;
     770             :                         } else {
     771           2 :                                 if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE)) {
     772           1 :                                         OBJ_RELEASE((zend_object*)fbc->op_array.prototype);
     773             :                                 }
     774             :                                 zend_vm_stack_free_args(call);
     775             :                         }
     776             :                 } else {
     777      105811 :                         ret = NULL;
     778      105811 :                         call->symbol_table = NULL;
     779      105811 :                         if (RETURN_VALUE_USED(opline)) {
     780        3501 :                                 ret = EX_VAR(opline->result.var);
     781        3501 :                                 ZVAL_NULL(ret);
     782        3501 :                                 Z_VAR_FLAGS_P(ret) = 0;
     783             :                         }
     784             : 
     785      105811 :                         call->prev_execute_data = execute_data;
     786      105811 :                         i_init_func_execute_data(call, &fbc->op_array, ret, 1);
     787             : 
     788      105811 :                         if (EXPECTED(zend_execute_ex == execute_ex)) {
     789      105811 :                                 ZEND_VM_ENTER();
     790             :                         } else {
     791           0 :                                 ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
     792           0 :                                 zend_execute_ex(call);
     793             :                         }
     794             :                 }
     795     2972658 :         } else if (EXPECTED(fbc->type < ZEND_USER_FUNCTION)) {
     796     2972658 :                 int should_change_scope = 0;
     797             : 
     798     2972658 :                 if (fbc->common.scope) {
     799     2958807 :                         should_change_scope = 1;
     800     2958807 :                         EG(scope) = fbc->common.scope;
     801             :                 }
     802             : 
     803     2972658 :                 call->prev_execute_data = execute_data;
     804     2972658 :                 EG(current_execute_data) = call;
     805             : 
     806     2972658 :                 if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
     807             :                         uint32_t i;
     808        1377 :                         uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
     809        1377 :                         zval *p = ZEND_CALL_ARG(call, 1);
     810             : 
     811        3374 :                         for (i = 0; i < num_args; ++i) {
     812        2192 :                                 zend_verify_internal_arg_type(fbc, i + 1, p);
     813        2192 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
     814         195 :                                         EG(current_execute_data) = call->prev_execute_data;
     815             :                                         zend_vm_stack_free_args(call);
     816         195 :                                         if (RETURN_VALUE_USED(opline)) {
     817         184 :                                                 ZVAL_UNDEF(EX_VAR(opline->result.var));
     818             :                                         }
     819         195 :                                         if (UNEXPECTED(should_change_scope)) {
     820          16 :                                                 goto fcall_end_change_scope;
     821             :                                         } else {
     822         179 :                                                 goto fcall_end;
     823             :                                         }
     824             :                                 }
     825        1997 :                                 p++;
     826             :                         }
     827             :                 }
     828             : 
     829     2972463 :                 ret = EX_VAR(opline->result.var);
     830     2972463 :                 ZVAL_NULL(ret);
     831     2972463 :                 Z_VAR_FLAGS_P(ret) = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0 ? IS_VAR_RET_REF : 0;
     832             : 
     833     2972463 :                 if (!zend_execute_internal) {
     834             :                         /* saves one function call if zend_execute_internal is not used */
     835     2972463 :                         fbc->internal_function.handler(call, ret);
     836             :                 } else {
     837           0 :                         zend_execute_internal(call, ret);
     838             :                 }
     839             : 
     840             : #if ZEND_DEBUG
     841             :                 ZEND_ASSERT(
     842             :                         !call->func ||
     843             :                         !(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
     844             :                         zend_verify_internal_return_type(call->func, EX_VAR(opline->result.var)));
     845             : #endif
     846             : 
     847     2972329 :                 EG(current_execute_data) = call->prev_execute_data;
     848             :                 zend_vm_stack_free_args(call);
     849             : 
     850     2972329 :                 if (!RETURN_VALUE_USED(opline)) {
     851      395201 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
     852             :                 }
     853             : 
     854     2972329 :                 if (UNEXPECTED(should_change_scope)) {
     855     2958658 :                         goto fcall_end_change_scope;
     856             :                 } else {
     857       13671 :                         goto fcall_end;
     858             :                 }
     859             :         } else { /* ZEND_OVERLOADED_FUNCTION */
     860           0 :                 EG(scope) = fbc->common.scope;
     861             : 
     862           0 :                 ZVAL_NULL(EX_VAR(opline->result.var));
     863             : 
     864             :                 /* Not sure what should be done here if it's a static method */
     865           0 :                 object = Z_OBJ(call->This);
     866           0 :                 if (EXPECTED(object != NULL)) {
     867           0 :                         call->prev_execute_data = execute_data;
     868           0 :                         EG(current_execute_data) = call;
     869           0 :                         object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var));
     870           0 :                         EG(current_execute_data) = call->prev_execute_data;
     871             :                 } else {
     872           0 :                         zend_throw_error(NULL, "Cannot call overloaded function for non-object");
     873             : #if 0
     874             :                         //TODO: implement clean exit ???
     875             :                         zend_vm_stack_free_args(call);
     876             : 
     877             :                         zend_vm_stack_free_call_frame(call);
     878             : 
     879             :                         if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
     880             :                                 zend_string_release(fbc->common.function_name);
     881             :                         }
     882             :                         efree(fbc);
     883             : #endif
     884           0 :                         HANDLE_EXCEPTION();
     885             :                 }
     886             : 
     887             :                 zend_vm_stack_free_args(call);
     888             : 
     889           0 :                 if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
     890           0 :                         zend_string_release(fbc->common.function_name);
     891             :                 }
     892           0 :                 efree(fbc);
     893             : 
     894           0 :                 if (!RETURN_VALUE_USED(opline)) {
     895           0 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
     896             :                 } else {
     897           0 :                         Z_VAR_FLAGS_P(EX_VAR(opline->result.var)) = 0;
     898             :                 }
     899             :         }
     900             : 
     901             : fcall_end_change_scope:
     902     2959065 :         if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) {
     903     2953939 :                 object = Z_OBJ(call->This);
     904             : #if 0
     905             :                 if (UNEXPECTED(EG(exception) != NULL) && (opline->op1.num & ZEND_CALL_CTOR)) {
     906             :                         if (!(opline->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) {
     907             : #else
     908     2953939 :                 if (UNEXPECTED(EG(exception) != NULL) && (ZEND_CALL_INFO(call) & ZEND_CALL_CTOR)) {
     909         366 :                         if (!(ZEND_CALL_INFO(call) & ZEND_CALL_CTOR_RESULT_UNUSED)) {
     910             : #endif
     911         285 :                                 GC_REFCOUNT(object)--;
     912             :                         }
     913         366 :                         if (GC_REFCOUNT(object) == 1) {
     914         366 :                                 zend_object_store_ctor_failed(object);
     915             :                         }
     916             :                 }
     917             :                 OBJ_RELEASE(object);
     918             :         }
     919     2959065 :         EG(scope) = EX(func)->op_array.scope;
     920             : 
     921             : fcall_end:
     922             :         zend_vm_stack_free_call_frame(call);
     923     2972915 :         if (UNEXPECTED(EG(exception) != NULL)) {
     924        1206 :                 zend_throw_exception_internal(NULL);
     925        1206 :                 if (RETURN_VALUE_USED(opline)) {
     926         457 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
     927             :                 }
     928        1206 :                 HANDLE_EXCEPTION();
     929             :         }
     930             : 
     931             :         ZEND_VM_INTERRUPT_CHECK();
     932     2971709 :         ZEND_VM_NEXT_OPCODE();
     933             : }
     934             : 
     935          65 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
     936             : {
     937          65 :         USE_OPLINE
     938             :         zend_free_op free_op1;
     939             :         zval *args;
     940             :         int arg_num;
     941             : 
     942             :         SAVE_OPLINE();
     943         130 :         args = get_zval_ptr_undef(opline->op1_type, opline->op1, execute_data, &free_op1, BP_VAR_R);
     944          65 :         arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1;
     945             : 
     946             : send_again:
     947          65 :         if (EXPECTED(Z_TYPE_P(args) == IS_ARRAY)) {
     948          48 :                 HashTable *ht = Z_ARRVAL_P(args);
     949             :                 zval *arg, *top;
     950             :                 zend_string *name;
     951             : 
     952          48 :                 zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
     953             : 
     954          48 :                 if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
     955             :                         uint32_t i;
     956           0 :                         int separate = 0;
     957             : 
     958             :                         /* check if any of arguments are going to be passed by reference */
     959           0 :                         for (i = 0; i < zend_hash_num_elements(ht); i++) {
     960           0 :                                 if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num + i)) {
     961           0 :                                         separate = 1;
     962           0 :                                         break;
     963             :                                 }
     964             :                         }
     965           0 :                         if (separate) {
     966             :                                 zval_copy_ctor(args);
     967           0 :                                 ht = Z_ARRVAL_P(args);
     968             :                         }
     969             :                 }
     970             : 
     971       42279 :                 ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
     972       21116 :                         if (name) {
     973           1 :                                 zend_throw_error(NULL, "Cannot unpack array with string keys");
     974           1 :                                 FREE_OP(free_op1);
     975           1 :                                 HANDLE_EXCEPTION();
     976             :                         }
     977             : 
     978       21115 :                         top = ZEND_CALL_ARG(EX(call), arg_num);
     979       42230 :                         if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
     980          20 :                                 if (!Z_IMMUTABLE_P(args)) {
     981          40 :                                         ZVAL_MAKE_REF(arg);
     982             :                                         Z_ADDREF_P(arg);
     983          20 :                                         ZVAL_REF(top, Z_REF_P(arg));
     984             :                                 } else {
     985           0 :                                         ZVAL_DUP(top, arg);
     986             :                                 }
     987       21095 :                         } else if (Z_ISREF_P(arg)) {
     988           7 :                                 ZVAL_COPY(top, Z_REFVAL_P(arg));
     989             :                         } else {
     990       21088 :                                 ZVAL_COPY(top, arg);
     991             :                         }
     992             : 
     993       21115 :                         ZEND_CALL_NUM_ARGS(EX(call))++;
     994       21115 :                         arg_num++;
     995             :                 } ZEND_HASH_FOREACH_END();
     996             : 
     997          17 :         } else if (EXPECTED(Z_TYPE_P(args) == IS_OBJECT)) {
     998          13 :                 zend_class_entry *ce = Z_OBJCE_P(args);
     999             :                 zend_object_iterator *iter;
    1000             : 
    1001          15 :                 if (!ce || !ce->get_iterator) {
    1002           2 :                         zend_error(E_WARNING, "Only arrays and Traversables can be unpacked");
    1003             :                 } else {
    1004             : 
    1005          11 :                         iter = ce->get_iterator(ce, args, 0);
    1006          11 :                         if (UNEXPECTED(!iter)) {
    1007           1 :                                 FREE_OP(free_op1);
    1008           1 :                                 if (!EG(exception)) {
    1009           0 :                                         zend_throw_exception_ex(
    1010           0 :                                                 NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name)
    1011             :                                         );
    1012             :                                 }
    1013           1 :                                 HANDLE_EXCEPTION();
    1014             :                         }
    1015             : 
    1016          10 :                         if (iter->funcs->rewind) {
    1017          10 :                                 iter->funcs->rewind(iter);
    1018          10 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    1019           0 :                                         goto unpack_iter_dtor;
    1020             :                                 }
    1021             :                         }
    1022             : 
    1023          31 :                         for (; iter->funcs->valid(iter) == SUCCESS; ++arg_num) {
    1024             :                                 zval *arg, *top;
    1025             : 
    1026          23 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    1027           0 :                                         goto unpack_iter_dtor;
    1028             :                                 }
    1029             : 
    1030          23 :                                 arg = iter->funcs->get_current_data(iter);
    1031          23 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    1032           0 :                                         goto unpack_iter_dtor;
    1033             :                                 }
    1034             : 
    1035          23 :                                 if (iter->funcs->get_current_key) {
    1036             :                                         zval key;
    1037          23 :                                         iter->funcs->get_current_key(iter, &key);
    1038          23 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    1039           0 :                                                 goto unpack_iter_dtor;
    1040             :                                         }
    1041             : 
    1042          23 :                                         if (Z_TYPE(key) == IS_STRING) {
    1043           1 :                                                 zend_throw_error(NULL,
    1044             :                                                         "Cannot unpack Traversable with string keys");
    1045           1 :                                                 zend_string_release(Z_STR(key));
    1046           1 :                                                 goto unpack_iter_dtor;
    1047             :                                         }
    1048             : 
    1049             :                                         zval_dtor(&key);
    1050             :                                 }
    1051             : 
    1052          44 :                                 if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
    1053           9 :                                         zend_error(
    1054             :                                                 E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()"
    1055             :                                                 " by unpacking a Traversable, passing by-value instead", arg_num,
    1056           3 :                                                 EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
    1057           3 :                                                 EX(call)->func->common.scope ? "::" : "",
    1058           3 :                                                 ZSTR_VAL(EX(call)->func->common.function_name)
    1059             :                                         );
    1060             :                                 }
    1061             : 
    1062          22 :                                 if (Z_ISREF_P(arg)) {
    1063           0 :                                         ZVAL_DUP(arg, Z_REFVAL_P(arg));
    1064             :                                 } else {
    1065          22 :                                         if (Z_REFCOUNTED_P(arg)) Z_ADDREF_P(arg);
    1066             :                                 }
    1067             : 
    1068          22 :                                 zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1);
    1069          22 :                                 top = ZEND_CALL_ARG(EX(call), arg_num);
    1070          22 :                                 ZVAL_COPY_VALUE(top, arg);
    1071          22 :                                 ZEND_CALL_NUM_ARGS(EX(call))++;
    1072             : 
    1073          22 :                                 iter->funcs->move_forward(iter);
    1074          22 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    1075           1 :                                         goto unpack_iter_dtor;
    1076             :                                 }
    1077             :                         }
    1078             : 
    1079             : unpack_iter_dtor:
    1080          10 :                         zend_iterator_dtor(iter);
    1081             :                 }
    1082           4 :         } else if (EXPECTED(Z_ISREF_P(args))) {
    1083           0 :                 args = Z_REFVAL_P(args);
    1084           0 :                 goto send_again;
    1085             :         } else {
    1086           4 :                 if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_P(args) == IS_UNDEF)) {
    1087           0 :                         GET_OP1_UNDEF_CV(args, BP_VAR_R);
    1088             :                 }
    1089           4 :                 zend_error(E_WARNING, "Only arrays and Traversables can be unpacked");
    1090             :         }
    1091             : 
    1092          63 :         FREE_OP(free_op1);
    1093          63 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1094             : }
    1095             : 
    1096         163 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1097             : {
    1098         163 :         USE_OPLINE
    1099             :         zend_free_op free_op1;
    1100             :         zval *args;
    1101             :         SAVE_OPLINE();
    1102             : 
    1103             :         SAVE_OPLINE();
    1104         326 :         args = get_zval_ptr(opline->op1_type, opline->op1, execute_data, &free_op1, BP_VAR_R);
    1105             : 
    1106         163 :         if (UNEXPECTED(Z_TYPE_P(args) != IS_ARRAY)) {
    1107         100 :                 if ((opline->op1_type & (IS_VAR|IS_CV)) && Z_ISREF_P(args)) {
    1108          25 :                         args = Z_REFVAL_P(args);
    1109          25 :                         if (EXPECTED(Z_TYPE_P(args) == IS_ARRAY)) {
    1110          25 :                                 goto send_array;
    1111             :                         }
    1112             :                 }
    1113          25 :                 zend_internal_type_error(EX_USES_STRICT_TYPES(), "call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
    1114          25 :                 if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
    1115           0 :                         OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
    1116             :                 }
    1117          25 :                 if (Z_OBJ(EX(call)->This)) {
    1118           0 :                         OBJ_RELEASE(Z_OBJ(EX(call)->This));
    1119             :                 }
    1120          25 :                 EX(call)->func = (zend_function*)&zend_pass_function;
    1121          25 :                 EX(call)->called_scope = NULL;
    1122          25 :                 Z_OBJ(EX(call)->This) = NULL;
    1123             :         } else {
    1124             :                 uint32_t arg_num;
    1125             :                 HashTable *ht;
    1126             :                 zval *arg, *param;
    1127             : 
    1128             : send_array:
    1129         138 :                 ht = Z_ARRVAL_P(args);
    1130         138 :                 zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
    1131             : 
    1132         138 :                 if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
    1133           0 :                         int separate = 0;
    1134             : 
    1135             :                         /* check if any of arguments are going to be passed by reference */
    1136           0 :                         for (arg_num = 0; arg_num < zend_hash_num_elements(ht); arg_num++) {
    1137           0 :                                 if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num + 1)) {
    1138           0 :                                         separate = 1;
    1139           0 :                                         break;
    1140             :                                 }
    1141             :                         }
    1142           0 :                         if (separate) {
    1143             :                                 zval_copy_ctor(args);
    1144           0 :                                 ht = Z_ARRVAL_P(args);
    1145             :                         }
    1146             :                 }
    1147             : 
    1148         138 :                 arg_num = 1;
    1149         138 :                 param = ZEND_CALL_ARG(EX(call), 1);
    1150      133815 :                 ZEND_HASH_FOREACH_VAL(ht, arg) {
    1151      133680 :                         if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
    1152       66540 :                                 if (UNEXPECTED(!Z_ISREF_P(arg))) {
    1153           8 :                                         if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
    1154             : 
    1155           9 :                                                 zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
    1156             :                                                         arg_num,
    1157           3 :                                                         EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
    1158           3 :                                                         EX(call)->func->common.scope ? "::" : "",
    1159           3 :                                                         ZSTR_VAL(EX(call)->func->common.function_name));
    1160             : 
    1161           3 :                                                 if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
    1162           1 :                                                         OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
    1163             :                                                 }
    1164           3 :                                                 if (Z_OBJ(EX(call)->This)) {
    1165           0 :                                                         OBJ_RELEASE(Z_OBJ(EX(call)->This));
    1166             :                                                 }
    1167           3 :                                                 EX(call)->func = (zend_function*)&zend_pass_function;
    1168           3 :                                                 EX(call)->called_scope = NULL;
    1169           3 :                                                 Z_OBJ(EX(call)->This) = NULL;
    1170             : 
    1171           3 :                                                 break;
    1172             :                                         }
    1173             : 
    1174           1 :                                         ZVAL_NEW_REF(arg, arg);
    1175             :                                 }
    1176             :                                 Z_ADDREF_P(arg);
    1177             :                         } else{
    1178         311 :                                 if (Z_ISREF_P(arg) &&
    1179          11 :                                     !(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
    1180             :                                         /* don't separate references for __call */
    1181           9 :                                         arg = Z_REFVAL_P(arg);
    1182             :                                 }
    1183         300 :                                 if (Z_OPT_REFCOUNTED_P(arg)) {
    1184             :                                         Z_ADDREF_P(arg);
    1185             :                                 }
    1186             :                         }
    1187       66837 :                         ZVAL_COPY_VALUE(param, arg);
    1188       66837 :                         ZEND_CALL_NUM_ARGS(EX(call))++;
    1189       66837 :                         arg_num++;
    1190       66837 :                         param++;
    1191             :                 } ZEND_HASH_FOREACH_END();
    1192             :         }
    1193         163 :         FREE_OP(free_op1);
    1194         163 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1195             : }
    1196             : 
    1197        1087 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1198             : {
    1199        1087 :         USE_OPLINE
    1200        1087 :         uint32_t arg_num = opline->op1.num;
    1201             : 
    1202        1087 :         if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
    1203             :                 SAVE_OPLINE();
    1204          74 :                 if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
    1205           9 :                         HANDLE_EXCEPTION();
    1206             :                 }
    1207        1013 :         } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
    1208        2026 :                 zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
    1209             : 
    1210             :                 SAVE_OPLINE();
    1211        2026 :                 if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num)))) {
    1212         135 :                         HANDLE_EXCEPTION();
    1213             :                 }
    1214             :         }
    1215             : 
    1216         943 :         ZEND_VM_NEXT_OPCODE();
    1217             : }
    1218             : 
    1219          48 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1220             : {
    1221          48 :         USE_OPLINE
    1222          48 :         uint32_t arg_num = opline->op1.num;
    1223          48 :         uint32_t arg_count = EX_NUM_ARGS();
    1224             :         zval *params;
    1225             : 
    1226             :         SAVE_OPLINE();
    1227             : 
    1228          96 :         params = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
    1229             : 
    1230          48 :         if (arg_num <= arg_count) {
    1231             :                 zval *param;
    1232             : 
    1233          33 :                 array_init_size(params, arg_count - arg_num + 1);
    1234          33 :                 zend_hash_real_init(Z_ARRVAL_P(params), 1);
    1235          33 :                 ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(params)) {
    1236          33 :                         param = EX_VAR_NUM(EX(func)->op_array.last_var + EX(func)->op_array.T);
    1237          33 :                         if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
    1238             :                                 do {
    1239          10 :                                         zend_verify_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num));
    1240          10 :                                         if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param);
    1241          10 :                                         ZEND_HASH_FILL_ADD(param);
    1242          10 :                                         param++;
    1243          10 :                                 } while (++arg_num <= arg_count);
    1244             :                         } else {
    1245             :                                 do {
    1246       21120 :                                         if (Z_OPT_REFCOUNTED_P(param)) Z_ADDREF_P(param);
    1247       21120 :                                         ZEND_HASH_FILL_ADD(param);
    1248       21120 :                                         param++;
    1249       21120 :                                 } while (++arg_num <= arg_count);
    1250             :                         }
    1251          33 :                 } ZEND_HASH_FILL_END();
    1252             :         } else {
    1253          15 :                 array_init(params);
    1254             :         }
    1255             : 
    1256          48 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1257             : }
    1258             : 
    1259     1399281 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1260             : {
    1261     1399281 :         USE_OPLINE
    1262             : 
    1263     1399281 :         ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
    1264             : 
    1265     1399281 :         if (EG(error_reporting)) {
    1266             :                 do {
    1267     1261343 :                         EG(error_reporting) = 0;
    1268     1261343 :                         if (!EG(error_reporting_ini_entry)) {
    1269        4400 :                                 zend_ini_entry *p = zend_hash_str_find_ptr(EG(ini_directives), "error_reporting", sizeof("error_reporting")-1);
    1270        2200 :                                 if (p) {
    1271        2200 :                                         EG(error_reporting_ini_entry) = p;
    1272             :                                 } else {
    1273           0 :                                         break;
    1274             :                                 }
    1275             :                         }
    1276     1261343 :                         if (!EG(error_reporting_ini_entry)->modified) {
    1277        2200 :                                 if (!EG(modified_ini_directives)) {
    1278        1653 :                                         ALLOC_HASHTABLE(EG(modified_ini_directives));
    1279        1653 :                                         zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
    1280             :                                 }
    1281        4400 :                                 if (EXPECTED(zend_hash_str_add_ptr(EG(modified_ini_directives), "error_reporting", sizeof("error_reporting")-1, EG(error_reporting_ini_entry)) != NULL)) {
    1282        2200 :                                         EG(error_reporting_ini_entry)->orig_value = EG(error_reporting_ini_entry)->value;
    1283        2200 :                                         EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
    1284        2200 :                                         EG(error_reporting_ini_entry)->modified = 1;
    1285             :                                 }
    1286             :                         }
    1287             :                 } while (0);
    1288             :         }
    1289     1399281 :         ZEND_VM_NEXT_OPCODE();
    1290             : }
    1291             : 
    1292           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1293             : {
    1294           0 :         USE_OPLINE
    1295             : 
    1296           0 :         if (!EG(no_extensions)) {
    1297             :                 SAVE_OPLINE();
    1298           0 :                 zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(func));
    1299           0 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1300             :         }
    1301           0 :         ZEND_VM_NEXT_OPCODE();
    1302             : }
    1303             : 
    1304           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1305             : {
    1306           0 :         USE_OPLINE
    1307             : 
    1308           0 :         if (!EG(no_extensions)) {
    1309             :                 SAVE_OPLINE();
    1310           0 :                 zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(func));
    1311           0 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1312             :         }
    1313           0 :         ZEND_VM_NEXT_OPCODE();
    1314             : }
    1315             : 
    1316           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1317             : {
    1318           0 :         USE_OPLINE
    1319             : 
    1320           0 :         if (!EG(no_extensions)) {
    1321             :                 SAVE_OPLINE();
    1322           0 :                 zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(func));
    1323           0 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1324             :         }
    1325           0 :         ZEND_VM_NEXT_OPCODE();
    1326             : }
    1327             : 
    1328         449 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1329             : {
    1330         449 :         USE_OPLINE
    1331             : 
    1332             :         SAVE_OPLINE();
    1333         449 :         Z_CE_P(EX_VAR(opline->result.var)) = do_bind_class(&EX(func)->op_array, opline, EG(class_table), 0);
    1334         441 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1335             : }
    1336             : 
    1337        1294 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1338             : {
    1339        1294 :         USE_OPLINE
    1340             : 
    1341             :         SAVE_OPLINE();
    1342        1294 :         Z_CE_P(EX_VAR(opline->result.var)) = do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0);
    1343        1291 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1344             : }
    1345             : 
    1346           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_DELAYED_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1347             : {
    1348           0 :         USE_OPLINE
    1349             :         zval *zce, *orig_zce;
    1350             : 
    1351             :         SAVE_OPLINE();
    1352           0 :         if ((zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op2)))) == NULL ||
    1353           0 :             ((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)))) != NULL &&
    1354           0 :              Z_CE_P(zce) != Z_CE_P(orig_zce))) {
    1355           0 :                 do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->extended_value)), 0);
    1356             :         }
    1357           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1358             : }
    1359             : 
    1360          24 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1361             : {
    1362             :         zend_class_entry *ce;
    1363          24 :         USE_OPLINE
    1364             : 
    1365             :         SAVE_OPLINE();
    1366          48 :         ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op2)));
    1367          24 :         Z_CE_P(EX_VAR(opline->result.var)) = ce;
    1368             :         ZEND_ASSERT(ce != NULL);
    1369             : 
    1370          24 :         if (ce->ce_flags & ZEND_ACC_ANON_BOUND) {
    1371          10 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op1));
    1372             :         }
    1373             : 
    1374          14 :         if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) {
    1375          12 :                 zend_verify_abstract_class(ce);
    1376             :         }
    1377          14 :         ce->ce_flags |= ZEND_ACC_ANON_BOUND;
    1378          14 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1379             : }
    1380             : 
    1381           3 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1382             : {
    1383             :         zend_class_entry *ce;
    1384           3 :         USE_OPLINE
    1385             : 
    1386             :         SAVE_OPLINE();
    1387           6 :         ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op2)));
    1388           3 :         Z_CE_P(EX_VAR(opline->result.var)) = ce;
    1389             :         ZEND_ASSERT(ce != NULL);
    1390             : 
    1391           3 :         if (ce->ce_flags & ZEND_ACC_ANON_BOUND) {
    1392           0 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op1));
    1393             :         }
    1394             : 
    1395           3 :         zend_do_inheritance(ce, Z_CE_P(EX_VAR(opline->extended_value)));
    1396           3 :         ce->ce_flags |= ZEND_ACC_ANON_BOUND;
    1397           3 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1398             : }
    1399             : 
    1400        2879 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1401             : {
    1402        2879 :         USE_OPLINE
    1403             : 
    1404             :         SAVE_OPLINE();
    1405        2879 :         do_bind_function(&EX(func)->op_array, opline, EG(function_table), 0);
    1406        2879 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1407             : }
    1408             : 
    1409          35 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1410             : {
    1411          35 :         USE_OPLINE
    1412             : 
    1413          35 :         if ((uint32_t)++EG(ticks_count) >= opline->extended_value) {
    1414          35 :                 EG(ticks_count) = 0;
    1415          35 :                 if (zend_ticks_function) {
    1416             :                         SAVE_OPLINE();
    1417          35 :                         zend_ticks_function(opline->extended_value);
    1418          35 :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1419             :                 }
    1420             :         }
    1421           0 :         ZEND_VM_NEXT_OPCODE();
    1422             : }
    1423             : 
    1424           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1425             : {
    1426           0 :         USE_OPLINE
    1427             : 
    1428           0 :         ZEND_VM_NEXT_OPCODE();
    1429             : }
    1430             : 
    1431      462085 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1432             : {
    1433      462085 :         USE_OPLINE
    1434             : 
    1435      462085 :         ZEND_VM_NEXT_OPCODE();
    1436             : }
    1437             : 
    1438         252 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_TRAIT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1439             : {
    1440         252 :         USE_OPLINE
    1441         252 :         zend_class_entry *ce = Z_CE_P(EX_VAR(opline->op1.var));
    1442             :         zend_class_entry *trait;
    1443             : 
    1444             :         SAVE_OPLINE();
    1445         252 :         trait = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    1446         252 :         if (UNEXPECTED(trait == NULL)) {
    1447         504 :                 trait = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)),
    1448         504 :                                                  EX_CONSTANT(opline->op2) + 1,
    1449             :                                                  ZEND_FETCH_CLASS_TRAIT);
    1450         250 :                 if (UNEXPECTED(trait == NULL)) {
    1451           0 :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1452             :                 }
    1453         250 :                 if (!(trait->ce_flags & ZEND_ACC_TRAIT)) {
    1454           4 :                         zend_error_noreturn(E_ERROR, "%s cannot use %s - it is not a trait", ZSTR_VAL(ce->name), ZSTR_VAL(trait->name));
    1455             :                 }
    1456         246 :                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), trait);
    1457             :         }
    1458             : 
    1459         246 :         zend_do_implement_trait(ce, trait);
    1460             : 
    1461         246 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1462             : }
    1463             : 
    1464         182 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_TRAITS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1465             : {
    1466         182 :         USE_OPLINE
    1467         182 :         zend_class_entry *ce = Z_CE_P(EX_VAR(opline->op1.var));
    1468             : 
    1469             :         SAVE_OPLINE();
    1470         182 :         zend_do_bind_traits(ce);
    1471         139 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1472             : }
    1473             : 
    1474        3203 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1475             : {
    1476        3203 :         uint32_t op_num = EG(opline_before_exception) - EX(func)->op_array.opcodes;
    1477             :         int i;
    1478        3203 :         uint32_t catch_op_num = 0, finally_op_num = 0, finally_op_end = 0;
    1479        3203 :         int in_finally = 0;
    1480             : 
    1481             :         ZEND_VM_INTERRUPT_CHECK();
    1482             : 
    1483             :         {
    1484        3203 :                 const zend_op *exc_opline = EG(opline_before_exception);
    1485        3206 :                 if ((exc_opline->opcode == ZEND_FREE || exc_opline->opcode == ZEND_FE_FREE)
    1486           3 :                         && exc_opline->extended_value & ZEND_FREE_ON_RETURN) {
    1487             :                         /* exceptions thrown because of loop var destruction on return/break/...
    1488             :                          * are logically thrown at the end of the foreach loop, so adjust the
    1489             :                          * op_num.
    1490             :                          */
    1491           3 :                         op_num = EX(func)->op_array.brk_cont_array[exc_opline->op2.num].brk;
    1492             :                 }
    1493             :         }
    1494             : 
    1495        7315 :         for (i = 0; i < EX(func)->op_array.last_try_catch; i++) {
    1496        4743 :                 if (EX(func)->op_array.try_catch_array[i].try_op > op_num) {
    1497             :                         /* further blocks will not be relevant... */
    1498         631 :                         break;
    1499             :                 }
    1500        4112 :                 in_finally = 0;
    1501        4112 :                 if (op_num < EX(func)->op_array.try_catch_array[i].catch_op) {
    1502        1994 :                         catch_op_num = EX(func)->op_array.try_catch_array[i].catch_op;
    1503             :                 }
    1504        4112 :                 if (op_num < EX(func)->op_array.try_catch_array[i].finally_op) {
    1505          52 :                         finally_op_num = EX(func)->op_array.try_catch_array[i].finally_op;
    1506          52 :                         finally_op_end = EX(func)->op_array.try_catch_array[i].finally_end;
    1507             :                 }
    1508        8172 :                 if (op_num >= EX(func)->op_array.try_catch_array[i].finally_op &&
    1509        4060 :                                 op_num < EX(func)->op_array.try_catch_array[i].finally_end) {
    1510          19 :                         finally_op_end = EX(func)->op_array.try_catch_array[i].finally_end;
    1511          19 :                         in_finally = 1;
    1512             :                 }
    1513             :         }
    1514             : 
    1515             :         i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
    1516             : 
    1517        3203 :         if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
    1518          16 :                 zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
    1519             : 
    1520          16 :                 if (in_finally && Z_OBJ_P(fast_call)) {
    1521           0 :                         zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
    1522             :                 }
    1523          16 :                 Z_OBJ_P(fast_call) = EG(exception);
    1524          16 :                 EG(exception) = NULL;
    1525          16 :                 fast_call->u2.lineno = (uint32_t)-1;
    1526          16 :                 ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
    1527          16 :                 ZEND_VM_CONTINUE();
    1528             :         } else {
    1529        3187 :                 if (in_finally) {
    1530             :                         /* we are going out of current finally scope */
    1531          12 :                         zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
    1532             : 
    1533          12 :                         if (Z_OBJ_P(fast_call)) {
    1534           2 :                                 zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
    1535           2 :                                 Z_OBJ_P(fast_call) = NULL;
    1536             :                         }
    1537             :                 }
    1538        3187 :                 if (catch_op_num) {
    1539        1960 :                         ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[catch_op_num]);
    1540        1960 :                         ZEND_VM_CONTINUE();
    1541        1227 :                 } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
    1542          26 :                         zend_generator *generator = zend_get_running_generator(execute_data);
    1543          26 :                         zend_generator_close(generator, 1);
    1544          26 :                         ZEND_VM_RETURN();
    1545             :                 } else {
    1546        1201 :                         ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    1547             :                 }
    1548             :         }
    1549             : }
    1550             : 
    1551         259 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1552             : {
    1553         259 :         USE_OPLINE
    1554             : 
    1555             :         SAVE_OPLINE();
    1556         259 :         zend_verify_abstract_class(Z_CE_P(EX_VAR(opline->op1.var)));
    1557         254 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1558             : }
    1559             : 
    1560           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1561             : {
    1562           0 :         USE_OPLINE
    1563             :         int ret;
    1564             : 
    1565             :         SAVE_OPLINE();
    1566           0 :         ret = zend_user_opcode_handlers[opline->opcode](execute_data);
    1567             :         LOAD_OPLINE();
    1568             : 
    1569           0 :         switch (ret) {
    1570             :                 case ZEND_USER_OPCODE_CONTINUE:
    1571           0 :                         ZEND_VM_CONTINUE();
    1572             :                 case ZEND_USER_OPCODE_RETURN:
    1573           0 :                         if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
    1574           0 :                                 zend_generator *generator = zend_get_running_generator(execute_data);
    1575           0 :                                 zend_generator_close(generator, 1);
    1576           0 :                                 ZEND_VM_RETURN();
    1577             :                         } else {
    1578           0 :                                 ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    1579             :                         }
    1580             :                 case ZEND_USER_OPCODE_ENTER:
    1581           0 :                         ZEND_VM_ENTER();
    1582             :                 case ZEND_USER_OPCODE_LEAVE:
    1583           0 :                         ZEND_VM_LEAVE();
    1584             :                 case ZEND_USER_OPCODE_DISPATCH:
    1585           0 :                         ZEND_VM_DISPATCH(opline->opcode, opline);
    1586             :                 default:
    1587           0 :                         ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
    1588             :         }
    1589             : }
    1590             : 
    1591          12 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1592             : {
    1593          12 :         USE_OPLINE
    1594          12 :         zval *fast_call = EX_VAR(opline->op1.var);
    1595             : 
    1596             :         /* check for delayed exception */
    1597          12 :         if (Z_OBJ_P(fast_call) != NULL) {
    1598             :                 SAVE_OPLINE();
    1599             :                 /* discard the previously thrown exception */
    1600           2 :                 OBJ_RELEASE(Z_OBJ_P(fast_call));
    1601           2 :                 Z_OBJ_P(fast_call) = NULL;
    1602             :         }
    1603             : 
    1604          12 :         ZEND_VM_NEXT_OPCODE();
    1605             : }
    1606             : 
    1607          63 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1608             : {
    1609          63 :         USE_OPLINE
    1610          63 :         zval *fast_call = EX_VAR(opline->result.var);
    1611             : 
    1612          64 :         if (opline->extended_value == ZEND_FAST_CALL_FROM_FINALLY && UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
    1613           1 :                 fast_call->u2.lineno = (uint32_t)-1;
    1614             :         } else {
    1615          62 :                 Z_OBJ_P(fast_call) = NULL;
    1616             :                 /* set return address */
    1617          62 :                 fast_call->u2.lineno = opline - EX(func)->op_array.opcodes;
    1618             :         }
    1619          63 :         ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op1));
    1620          63 :         ZEND_VM_CONTINUE();
    1621             : }
    1622             : 
    1623          62 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1624             : {
    1625          62 :         USE_OPLINE
    1626          62 :         zval *fast_call = EX_VAR(opline->op1.var);
    1627             : 
    1628          62 :         if (fast_call->u2.lineno != (uint32_t)-1) {
    1629          43 :                 const zend_op *fast_ret = EX(func)->op_array.opcodes + fast_call->u2.lineno;
    1630          43 :                 ZEND_VM_SET_OPCODE(fast_ret + 1);
    1631          43 :                 if (fast_ret->extended_value & ZEND_FAST_CALL_FROM_FINALLY) {
    1632           8 :                         fast_call->u2.lineno = fast_ret->op2.opline_num;
    1633             :                 }
    1634          43 :                 ZEND_VM_CONTINUE();
    1635             :         } else {
    1636             :                 /* special case for unhandled exceptions */
    1637          19 :                 USE_OPLINE
    1638             : 
    1639          19 :                 if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
    1640           5 :                         ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
    1641           5 :                         ZEND_VM_CONTINUE();
    1642             :                 } else {
    1643          14 :                         EG(exception) = Z_OBJ_P(fast_call);
    1644          14 :                         Z_OBJ_P(fast_call) = NULL;
    1645          14 :                         if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
    1646           6 :                                 ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
    1647           6 :                                 ZEND_VM_CONTINUE();
    1648           8 :                         } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
    1649           4 :                                 zend_generator *generator = zend_get_running_generator(execute_data);
    1650           4 :                                 zend_generator_close(generator, 1);
    1651           4 :                                 ZEND_VM_RETURN();
    1652             :                         } else {
    1653           4 :                                 ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    1654             :                         }
    1655             :                 }
    1656             :         }
    1657             : }
    1658             : 
    1659      100295 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSERT_CHECK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1660             : {
    1661      100295 :         USE_OPLINE
    1662             : 
    1663      100295 :         if (EG(assertions) <= 0) {
    1664          17 :                 zend_op *target = OP_JMP_ADDR(opline, opline->op2);
    1665          17 :                 zend_op *result = target - 1;
    1666          17 :                 SKIP_EXT_OPLINE(result);
    1667          17 :                 if (RETURN_VALUE_USED(result)) {
    1668           7 :                         ZVAL_TRUE(EX_VAR(result->result.var));
    1669             :                 }
    1670          17 :                 ZEND_VM_JMP(target);
    1671             :         } else {
    1672      100278 :                 ZEND_VM_NEXT_OPCODE();
    1673             :         }
    1674             : }
    1675             : 
    1676          35 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1677             : {
    1678             :         uint32_t fetch_type;
    1679          35 :         USE_OPLINE
    1680             : 
    1681             :         SAVE_OPLINE();
    1682          35 :         fetch_type = opline->extended_value;
    1683             : 
    1684          35 :         if (UNEXPECTED(EG(scope) == NULL)) {
    1685           3 :                 zend_throw_error(NULL, "Cannot use \"%s\" when no class scope is active",
    1686             :                         fetch_type == ZEND_FETCH_CLASS_SELF ? "self" :
    1687             :                         fetch_type == ZEND_FETCH_CLASS_PARENT ? "parent" : "static");
    1688           3 :                 HANDLE_EXCEPTION();
    1689             :         }
    1690             : 
    1691          32 :         switch (fetch_type) {
    1692             :                 case ZEND_FETCH_CLASS_SELF:
    1693          15 :                         ZVAL_STR_COPY(EX_VAR(opline->result.var), EG(scope)->name);
    1694          15 :                         break;
    1695             :                 case ZEND_FETCH_CLASS_PARENT:
    1696           3 :                         if (UNEXPECTED(EG(scope)->parent == NULL)) {
    1697           1 :                                 zend_throw_error(NULL,
    1698             :                                         "Cannot use \"parent\" when current class scope has no parent");
    1699           1 :                                 HANDLE_EXCEPTION();
    1700             :                         }
    1701           2 :                         ZVAL_STR_COPY(EX_VAR(opline->result.var), EG(scope)->parent->name);
    1702           2 :                         break;
    1703             :                 case ZEND_FETCH_CLASS_STATIC:
    1704          14 :                         ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(called_scope)->name);
    1705             :                         break;
    1706             :                 EMPTY_SWITCH_DEFAULT_CASE()
    1707             :         }
    1708          31 :         ZEND_VM_NEXT_OPCODE();
    1709             : }
    1710             : 
    1711         495 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1712             : {
    1713             :         zend_array *args;
    1714         495 :         zend_function *fbc = EX(func);
    1715         495 :         zend_object *object = Z_OBJ(EX(This));
    1716         495 :         zval *ret = EX(return_value);
    1717         495 :         uint32_t call_info = EX_CALL_INFO() & (ZEND_CALL_NESTED | ZEND_CALL_TOP | ZEND_CALL_RELEASE_THIS);
    1718         495 :         zend_class_entry *scope = EX(called_scope);
    1719         495 :         uint32_t num_args = EX_NUM_ARGS();
    1720             :         zend_execute_data *call;
    1721         495 :         USE_OPLINE
    1722             : 
    1723         495 :         args = emalloc(sizeof(zend_array));
    1724         495 :         zend_hash_init(args, num_args, NULL, ZVAL_PTR_DTOR, 0);
    1725         495 :         if (num_args) {
    1726         335 :                 zval *p = ZEND_CALL_ARG(execute_data, 1);
    1727         335 :                 zval *end = p + num_args;
    1728             : 
    1729         335 :                 zend_hash_real_init(args, 1);
    1730         335 :                 ZEND_HASH_FILL_PACKED(args) {
    1731             :                         do {
    1732         448 :                                 ZEND_HASH_FILL_ADD(p);
    1733         448 :                                 p++;
    1734         448 :                         } while (p != end);
    1735         335 :                 } ZEND_HASH_FILL_END();
    1736             :         }
    1737             : 
    1738             :         SAVE_OPLINE();
    1739         495 :         call = execute_data;
    1740         495 :         execute_data = EG(current_execute_data) = EX(prev_execute_data);
    1741             :         zend_vm_stack_free_call_frame(call);
    1742         990 :         call = zend_vm_stack_push_call_frame(call_info, fbc->common.prototype, 2, scope, object);
    1743         495 :         call->prev_execute_data = execute_data;
    1744             : 
    1745         495 :         ZVAL_STR(ZEND_CALL_ARG(call, 1), fbc->common.function_name);
    1746         495 :         ZVAL_ARR(ZEND_CALL_ARG(call, 2), args);
    1747         495 :         zend_free_trampoline(fbc);
    1748         495 :         fbc = call->func;
    1749             : 
    1750         495 :         if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
    1751             : 
    1752             :                 ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_GENERATOR));
    1753             : 
    1754         170 :                 call->symbol_table = NULL;
    1755         170 :                 i_init_func_execute_data(call, &fbc->op_array,
    1756         170 :                                 ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0);
    1757             : 
    1758         170 :                 if (EXPECTED(zend_execute_ex == execute_ex)) {
    1759         170 :                         ZEND_VM_ENTER();
    1760             :                 } else {
    1761           0 :                         ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
    1762           0 :                         zend_execute_ex(call);
    1763             :                 }
    1764             :         } else {
    1765             :                 zval retval;
    1766             : 
    1767             :                 ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION);
    1768             : 
    1769         325 :                 EG(current_execute_data) = call;
    1770             : 
    1771         325 :                 if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
    1772             :                         uint32_t i;
    1773           0 :                         uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
    1774           0 :                         zval *p = ZEND_CALL_ARG(call, 1);
    1775             : 
    1776           0 :                         EG(current_execute_data) = call;
    1777             : 
    1778           0 :                         for (i = 0; i < num_args; ++i) {
    1779           0 :                                 zend_verify_internal_arg_type(fbc, i + 1, p);
    1780           0 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    1781           0 :                                         EG(current_execute_data) = call->prev_execute_data;
    1782             :                                         zend_vm_stack_free_args(call);
    1783             :                                         zend_vm_stack_free_call_frame(call);
    1784           0 :                                         if (ret) {
    1785           0 :                                                 ZVAL_UNDEF(ret);
    1786             :                                         }
    1787           0 :                                         goto call_trampoline_end;
    1788             :                                 }
    1789           0 :                                 p++;
    1790             :                         }
    1791             :                 }
    1792             : 
    1793         325 :                 if (ret == NULL) {
    1794         257 :                         ZVAL_NULL(&retval);
    1795         257 :                         ret = &retval;
    1796             :                 }
    1797         325 :                 Z_VAR_FLAGS_P(ret) = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0 ? IS_VAR_RET_REF : 0;
    1798             : 
    1799         325 :                 if (!zend_execute_internal) {
    1800             :                         /* saves one function call if zend_execute_internal is not used */
    1801         325 :                         fbc->internal_function.handler(call, ret);
    1802             :                 } else {
    1803           0 :                         zend_execute_internal(call, ret);
    1804             :                 }
    1805             : 
    1806             : #if ZEND_DEBUG
    1807             :                 ZEND_ASSERT(
    1808             :                         !call->func ||
    1809             :                         !(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
    1810             :                         zend_verify_internal_return_type(call->func, EX_VAR(opline->result.var)));
    1811             : #endif
    1812             : 
    1813         317 :                 EG(current_execute_data) = call->prev_execute_data;
    1814             : 
    1815             :                 zend_vm_stack_free_args(call);
    1816             : 
    1817         317 :                 if (ret == &retval) {
    1818             :                         zval_ptr_dtor(ret);
    1819             :                 }
    1820             :         }
    1821             : 
    1822             : call_trampoline_end:
    1823         317 :         execute_data = EG(current_execute_data);
    1824             : 
    1825         317 :         if (!EX(func) || !ZEND_USER_CODE(EX(func)->type) || (call_info & ZEND_CALL_TOP)) {
    1826           0 :                 ZEND_VM_RETURN();
    1827             :         }
    1828             : 
    1829         317 :         opline = EX(opline);
    1830             : 
    1831         317 :         if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
    1832         317 :                 object = Z_OBJ(call->This);
    1833             :                 OBJ_RELEASE(object);
    1834             :         }
    1835         317 :         EG(scope) = EX(func)->op_array.scope;
    1836             :         zend_vm_stack_free_call_frame(call);
    1837             : 
    1838         317 :         if (UNEXPECTED(EG(exception) != NULL)) {
    1839           4 :                 zend_throw_exception_internal(NULL);
    1840           4 :                 if (RETURN_VALUE_USED(opline)) {
    1841           2 :                         zval_ptr_dtor(EX_VAR(opline->result.var));
    1842             :                 }
    1843           4 :                 HANDLE_EXCEPTION_LEAVE();
    1844             :         }
    1845             : 
    1846         313 :         ZEND_VM_INC_OPCODE();
    1847         313 :         ZEND_VM_LEAVE();
    1848             : }
    1849             : 
    1850        1299 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1851             : {
    1852        1299 :         USE_OPLINE
    1853             : 
    1854             :         SAVE_OPLINE();
    1855        1299 :         if (IS_CONST == IS_UNUSED) {
    1856             :                 Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
    1857             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1858             :         } else {
    1859             : 
    1860        1299 :                 zval *class_name = EX_CONSTANT(opline->op2);
    1861             : 
    1862             : try_class_name:
    1863             :                 if (IS_CONST == IS_CONST) {
    1864        1299 :                         zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
    1865             : 
    1866        1299 :                         if (UNEXPECTED(ce == NULL)) {
    1867        1299 :                                 ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
    1868        1298 :                                 CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
    1869             :                         }
    1870        1298 :                         Z_CE_P(EX_VAR(opline->result.var)) = ce;
    1871             :                 } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
    1872             :                         Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
    1873             :                 } else if (Z_TYPE_P(class_name) == IS_STRING) {
    1874             :                         Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
    1875             :                 } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
    1876             :                         class_name = Z_REFVAL_P(class_name);
    1877             :                         goto try_class_name;
    1878             :                 } else {
    1879             :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) {
    1880             :                                 GET_OP2_UNDEF_CV(class_name, BP_VAR_R);
    1881             :                         }
    1882             :                         if (UNEXPECTED(EG(exception) != NULL)) {
    1883             :                                 HANDLE_EXCEPTION();
    1884             :                         }
    1885             :                         zend_throw_error(NULL, "Class name must be a valid object or a string");
    1886             :                 }
    1887             : 
    1888        1298 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1889             :         }
    1890             : }
    1891             : 
    1892      329300 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1893             : {
    1894      329300 :         USE_OPLINE
    1895             :         zend_function *fbc;
    1896             :         zval *function_name, *func;
    1897             :         zend_execute_data *call;
    1898             : 
    1899      329300 :         fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    1900      329300 :         if (UNEXPECTED(fbc == NULL)) {
    1901        2858 :                 function_name = (zval*)(EX_CONSTANT(opline->op2)+1);
    1902        2858 :                 func = zend_hash_find(EG(function_table), Z_STR_P(function_name));
    1903        2858 :                 if (UNEXPECTED(func == NULL)) {
    1904             :                         SAVE_OPLINE();
    1905          19 :                         zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    1906          19 :                         HANDLE_EXCEPTION();
    1907             :                 }
    1908        2839 :                 fbc = Z_FUNC_P(func);
    1909        2839 :                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), fbc);
    1910             :         }
    1911      658562 :         call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
    1912             :                 fbc, opline->extended_value, NULL, NULL);
    1913      329281 :         call->prev_execute_data = EX(call);
    1914      329281 :         EX(call) = call;
    1915             : 
    1916      329281 :         ZEND_VM_NEXT_OPCODE();
    1917             : }
    1918             : 
    1919           3 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    1920             : {
    1921           3 :         USE_OPLINE
    1922             :         zend_function *fbc;
    1923             :         zval *function_name, *func;
    1924             :         zend_string *lcname;
    1925             : 
    1926             :         zend_class_entry *called_scope;
    1927             :         zend_object *object;
    1928             :         zend_execute_data *call;
    1929           3 :         uint32_t call_info = ZEND_CALL_NESTED_FUNCTION;
    1930             : 
    1931             :         SAVE_OPLINE();
    1932           3 :         function_name = EX_CONSTANT(opline->op2);
    1933             : 
    1934             : try_function_name:
    1935           3 :         if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
    1936             :                 const char *colon;
    1937             : 
    1938             :                 if ((colon = zend_memrchr(Z_STRVAL_P(function_name), ':', Z_STRLEN_P(function_name))) != NULL &&
    1939             :                         colon > Z_STRVAL_P(function_name) &&
    1940             :                         *(colon-1) == ':'
    1941             :                 ) {
    1942             :                         zend_string *mname;
    1943             :                         size_t cname_length = colon - Z_STRVAL_P(function_name) - 1;
    1944             :                         size_t mname_length = Z_STRLEN_P(function_name) - cname_length - (sizeof("::") - 1);
    1945             : 
    1946             :                         lcname = zend_string_init(Z_STRVAL_P(function_name), cname_length, 0);
    1947             : 
    1948             :                         object = NULL;
    1949             :                         called_scope = zend_fetch_class_by_name(lcname, NULL, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    1950             :                         if (UNEXPECTED(called_scope == NULL)) {
    1951             :                                 zend_string_release(lcname);
    1952             :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    1953             :                         }
    1954             : 
    1955             :                         mname = zend_string_init(Z_STRVAL_P(function_name) + (cname_length + sizeof("::") - 1), mname_length, 0);
    1956             : 
    1957             :                         if (called_scope->get_static_method) {
    1958             :                                 fbc = called_scope->get_static_method(called_scope, mname);
    1959             :                         } else {
    1960             :                                 fbc = zend_std_get_static_method(called_scope, mname, NULL);
    1961             :                         }
    1962             :                         if (UNEXPECTED(fbc == NULL)) {
    1963             :                                 if (EXPECTED(!EG(exception))) {
    1964             :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname));
    1965             :                                 }
    1966             :                                 zend_string_release(lcname);
    1967             :                                 zend_string_release(mname);
    1968             : 
    1969             :                                 HANDLE_EXCEPTION();
    1970             :                         }
    1971             : 
    1972             :                         zend_string_release(lcname);
    1973             :                         zend_string_release(mname);
    1974             : 
    1975             :                         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    1976             :                                 if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    1977             :                                         zend_error(E_DEPRECATED,
    1978             :                                                 "Non-static method %s::%s() should not be called statically",
    1979             :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    1980             :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    1981             :                                                 HANDLE_EXCEPTION();
    1982             :                                         }
    1983             :                                 } else {
    1984             :                                         zend_throw_error(
    1985             :                                                 zend_ce_error,
    1986             :                                                 "Non-static method %s::%s() cannot be called statically",
    1987             :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    1988             : 
    1989             :                                         HANDLE_EXCEPTION();
    1990             :                                 }
    1991             :                         }
    1992             :                 } else {
    1993             :                         if (Z_STRVAL_P(function_name)[0] == '\\') {
    1994             :                                 lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
    1995             :                                 zend_str_tolower_copy(ZSTR_VAL(lcname), Z_STRVAL_P(function_name) + 1, Z_STRLEN_P(function_name) - 1);
    1996             :                         } else {
    1997             :                                 lcname = zend_string_tolower(Z_STR_P(function_name));
    1998             :                         }
    1999             :                         if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
    2000             :                                 zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
    2001             :                                 zend_string_release(lcname);
    2002             : 
    2003             :                                 HANDLE_EXCEPTION();
    2004             :                         }
    2005             :                         zend_string_release(lcname);
    2006             : 
    2007             :                         fbc = Z_FUNC_P(func);
    2008             :                         called_scope = NULL;
    2009             :                         object = NULL;
    2010             :                 }
    2011             : 
    2012           3 :         } else if (IS_CONST != IS_CONST &&
    2013             :             EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
    2014             :                 Z_OBJ_HANDLER_P(function_name, get_closure) &&
    2015             :                 Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
    2016             :                 if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
    2017             :                         /* Delay closure destruction until its invocation */
    2018             :                         ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
    2019             :                         GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
    2020             :                         call_info |= ZEND_CALL_CLOSURE;
    2021             :                 } else if (object) {
    2022             :                         call_info |= ZEND_CALL_RELEASE_THIS;
    2023             :                         GC_REFCOUNT(object)++; /* For $this pointer */
    2024             :                 }
    2025             : 
    2026           9 :         } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
    2027           3 :                         zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
    2028             :                 zval *obj;
    2029             :                 zval *method;
    2030           3 :                 obj = zend_hash_index_find(Z_ARRVAL_P(function_name), 0);
    2031           3 :                 method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1);
    2032             : 
    2033           3 :                 if (!obj || !method) {
    2034           0 :                         zend_throw_error(NULL, "Array callback has to contain indices 0 and 1");
    2035             : 
    2036           0 :                         HANDLE_EXCEPTION();
    2037             :                 }
    2038             : 
    2039           3 :                 ZVAL_DEREF(obj);
    2040           3 :                 if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) {
    2041           0 :                         zend_throw_error(NULL, "First array member is not a valid class name or object");
    2042             : 
    2043           0 :                         HANDLE_EXCEPTION();
    2044             :                 }
    2045             : 
    2046           3 :                 ZVAL_DEREF(method);
    2047           3 :                 if (Z_TYPE_P(method) != IS_STRING) {
    2048           0 :                         zend_throw_error(NULL, "Second array member is not a valid method");
    2049             : 
    2050           0 :                         HANDLE_EXCEPTION();
    2051             :                 }
    2052             : 
    2053           3 :                 if (Z_TYPE_P(obj) == IS_STRING) {
    2054           3 :                         object = NULL;
    2055           3 :                         called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    2056           3 :                         if (UNEXPECTED(called_scope == NULL)) {
    2057           0 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2058             :                         }
    2059             : 
    2060           3 :                         if (called_scope->get_static_method) {
    2061           0 :                                 fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
    2062             :                         } else {
    2063           3 :                                 fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
    2064             :                         }
    2065           3 :                         if (UNEXPECTED(fbc == NULL)) {
    2066           0 :                                 if (EXPECTED(!EG(exception))) {
    2067           0 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method));
    2068             :                                 }
    2069             : 
    2070           0 :                                 HANDLE_EXCEPTION();
    2071             :                         }
    2072           3 :                         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    2073           0 :                                 if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    2074           0 :                                         zend_error(E_DEPRECATED,
    2075             :                                                 "Non-static method %s::%s() should not be called statically",
    2076           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2077           0 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    2078           0 :                                                 HANDLE_EXCEPTION();
    2079             :                                         }
    2080             :                                 } else {
    2081           0 :                                         zend_throw_error(
    2082             :                                                 zend_ce_error,
    2083             :                                                 "Non-static method %s::%s() cannot be called statically",
    2084           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2085             : 
    2086           0 :                                         HANDLE_EXCEPTION();
    2087             :                                 }
    2088             :                         }
    2089             :                 } else {
    2090           0 :                         called_scope = Z_OBJCE_P(obj);
    2091           0 :                         object = Z_OBJ_P(obj);
    2092             : 
    2093           0 :                         fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
    2094           0 :                         if (UNEXPECTED(fbc == NULL)) {
    2095           0 :                                 if (EXPECTED(!EG(exception))) {
    2096           0 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method));
    2097             :                                 }
    2098             : 
    2099           0 :                                 HANDLE_EXCEPTION();
    2100             :                         }
    2101             : 
    2102           0 :                         if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
    2103           0 :                                 object = NULL;
    2104             :                         } else {
    2105           0 :                                 call_info |= ZEND_CALL_RELEASE_THIS;
    2106           0 :                                 GC_REFCOUNT(object)++; /* For $this pointer */
    2107             :                         }
    2108             :                 }
    2109             : 
    2110           0 :         } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
    2111             :                 function_name = Z_REFVAL_P(function_name);
    2112             :                 goto try_function_name;
    2113             :         } else {
    2114           0 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    2115             :                         GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    2116             :                 }
    2117           0 :                 if (UNEXPECTED(EG(exception) != NULL)) {
    2118           0 :                         HANDLE_EXCEPTION();
    2119             :                 }
    2120           0 :                 zend_throw_error(NULL, "Function name must be a string");
    2121             : 
    2122           0 :                 HANDLE_EXCEPTION();
    2123             :         }
    2124           6 :         call = zend_vm_stack_push_call_frame(call_info,
    2125             :                 fbc, opline->extended_value, called_scope, object);
    2126           3 :         call->prev_execute_data = EX(call);
    2127           3 :         EX(call) = call;
    2128             : 
    2129           3 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2130             : }
    2131             : 
    2132         363 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2133             : {
    2134         363 :         USE_OPLINE
    2135             :         zval *func_name;
    2136             :         zval *func;
    2137             :         zend_function *fbc;
    2138             :         zend_execute_data *call;
    2139             : 
    2140         363 :         func_name = EX_CONSTANT(opline->op2) + 1;
    2141         363 :         fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    2142         363 :         if (UNEXPECTED(fbc == NULL)) {
    2143         350 :                 func = zend_hash_find(EG(function_table), Z_STR_P(func_name));
    2144         350 :                 if (func == NULL) {
    2145         295 :                         func_name++;
    2146         295 :                         func = zend_hash_find(EG(function_table), Z_STR_P(func_name));
    2147         295 :                         if (UNEXPECTED(func == NULL)) {
    2148             :                                 SAVE_OPLINE();
    2149           0 :                                 zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    2150           0 :                                 HANDLE_EXCEPTION();
    2151             :                         }
    2152             :                 }
    2153         350 :                 fbc = Z_FUNC_P(func);
    2154         350 :                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), fbc);
    2155             :         }
    2156             : 
    2157         726 :         call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
    2158             :                 fbc, opline->extended_value, NULL, NULL);
    2159         363 :         call->prev_execute_data = EX(call);
    2160         363 :         EX(call) = call;
    2161             : 
    2162         363 :         ZEND_VM_NEXT_OPCODE();
    2163             : }
    2164             : 
    2165    23492971 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2166             : {
    2167    23492971 :         USE_OPLINE
    2168             : 
    2169    23492971 :         zval *fname = EX_CONSTANT(opline->op2);
    2170             :         zval *func;
    2171             :         zend_function *fbc;
    2172             :         zend_execute_data *call;
    2173             : 
    2174    23492971 :         fbc = CACHED_PTR(Z_CACHE_SLOT_P(fname));
    2175    23492971 :         if (UNEXPECTED(fbc == NULL)) {
    2176      152626 :                 func = zend_hash_find(EG(function_table), Z_STR_P(fname));
    2177      152626 :                 if (UNEXPECTED(func == NULL)) {
    2178             :                     SAVE_OPLINE();
    2179           0 :                         zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(fname));
    2180           0 :                         HANDLE_EXCEPTION();
    2181             :                 }
    2182      152626 :                 fbc = Z_FUNC_P(func);
    2183      152626 :                 CACHE_PTR(Z_CACHE_SLOT_P(fname), fbc);
    2184             :         }
    2185             : 
    2186    46985942 :         call = zend_vm_stack_push_call_frame_ex(
    2187             :                 opline->op1.num, ZEND_CALL_NESTED_FUNCTION,
    2188             :                 fbc, opline->extended_value, NULL, NULL);
    2189    23492971 :         call->prev_execute_data = EX(call);
    2190    23492971 :         EX(call) = call;
    2191             : 
    2192    23492971 :         ZEND_VM_NEXT_OPCODE();
    2193             : }
    2194             : 
    2195      158641 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2196             : {
    2197      158641 :         USE_OPLINE
    2198             :         uint32_t arg_num;
    2199             :         zval *param;
    2200             : 
    2201             :         ZEND_VM_REPEATABLE_OPCODE
    2202             : 
    2203      189152 :         arg_num = opline->op1.num;
    2204      378304 :         param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
    2205      189152 :         if (arg_num > EX_NUM_ARGS()) {
    2206      101664 :                 ZVAL_COPY_VALUE(param, EX_CONSTANT(opline->op2));
    2207      101664 :                 if (Z_OPT_CONSTANT_P(param)) {
    2208             :                         SAVE_OPLINE();
    2209         122 :                         if (UNEXPECTED(zval_update_constant_ex(param, 0, NULL) != SUCCESS)) {
    2210          15 :                                 ZVAL_UNDEF(param);
    2211          15 :                                 HANDLE_EXCEPTION();
    2212             :                         }
    2213             :                 } else {
    2214             :                         /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
    2215      101542 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(param))) {
    2216          25 :                                 zval_copy_ctor_func(param);
    2217             :                         }
    2218             :                 }
    2219             :         }
    2220             : 
    2221      189132 :         if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
    2222       87580 :                 zval *default_value = EX_CONSTANT(opline->op2);
    2223             : 
    2224             :                 SAVE_OPLINE();
    2225      175160 :                 if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))))) {
    2226           7 :                         HANDLE_EXCEPTION();
    2227             :                 }
    2228             :         }
    2229             : 
    2230      189125 :         ZEND_VM_REPEAT_OPCODE(ZEND_RECV_INIT);
    2231             :         ZEND_VM_NEXT_OPCODE();
    2232             : }
    2233             : 
    2234         386 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2235             : {
    2236         386 :         USE_OPLINE
    2237         386 :         zend_class_entry *ce = Z_CE_P(EX_VAR(opline->op1.var));
    2238             :         zend_class_entry *iface;
    2239             : 
    2240             :         SAVE_OPLINE();
    2241         386 :         iface = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    2242         386 :         if (UNEXPECTED(iface == NULL)) {
    2243         386 :                 iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
    2244         384 :                 if (UNEXPECTED(iface == NULL)) {
    2245           1 :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2246             :                 }
    2247         383 :                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), iface);
    2248             :         }
    2249             : 
    2250         383 :         if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
    2251           4 :                 zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ZSTR_VAL(ce->name), ZSTR_VAL(iface->name));
    2252             :         }
    2253         379 :         zend_do_implement_interface(ce, iface);
    2254             : 
    2255         349 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2256             : }
    2257             : 
    2258        3085 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2259             : {
    2260        3085 :         USE_OPLINE
    2261             : 
    2262             :         SAVE_OPLINE();
    2263             :         if (IS_UNUSED == IS_UNUSED) {
    2264        3085 :                 Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
    2265        3085 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2266             :         } else {
    2267             : 
    2268             :                 zval *class_name = NULL;
    2269             : 
    2270             : try_class_name:
    2271             :                 if (IS_UNUSED == IS_CONST) {
    2272             :                         zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
    2273             : 
    2274             :                         if (UNEXPECTED(ce == NULL)) {
    2275             :                                 ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
    2276             :                                 CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
    2277             :                         }
    2278             :                         Z_CE_P(EX_VAR(opline->result.var)) = ce;
    2279             :                 } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
    2280             :                         Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
    2281             :                 } else if (Z_TYPE_P(class_name) == IS_STRING) {
    2282             :                         Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
    2283             :                 } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
    2284             :                         class_name = Z_REFVAL_P(class_name);
    2285             :                         goto try_class_name;
    2286             :                 } else {
    2287             :                         if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) {
    2288             :                                 GET_OP2_UNDEF_CV(class_name, BP_VAR_R);
    2289             :                         }
    2290             :                         if (UNEXPECTED(EG(exception) != NULL)) {
    2291             :                                 HANDLE_EXCEPTION();
    2292             :                         }
    2293             :                         zend_throw_error(NULL, "Class name must be a valid object or a string");
    2294             :                 }
    2295             : 
    2296             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2297             :         }
    2298             : }
    2299             : 
    2300        1141 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2301             : {
    2302        1141 :         USE_OPLINE
    2303             : 
    2304             :         SAVE_OPLINE();
    2305        1141 :         if (IS_CV == IS_UNUSED) {
    2306             :                 Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
    2307             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2308             :         } else {
    2309             : 
    2310        2282 :                 zval *class_name = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    2311             : 
    2312             : try_class_name:
    2313        1141 :                 if (IS_CV == IS_CONST) {
    2314             :                         zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
    2315             : 
    2316             :                         if (UNEXPECTED(ce == NULL)) {
    2317             :                                 ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
    2318             :                                 CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
    2319             :                         }
    2320             :                         Z_CE_P(EX_VAR(opline->result.var)) = ce;
    2321        1141 :                 } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
    2322          21 :                         Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
    2323        1120 :                 } else if (Z_TYPE_P(class_name) == IS_STRING) {
    2324        1117 :                         Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
    2325           3 :                 } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
    2326           0 :                         class_name = Z_REFVAL_P(class_name);
    2327           0 :                         goto try_class_name;
    2328             :                 } else {
    2329           3 :                         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) {
    2330           3 :                                 GET_OP2_UNDEF_CV(class_name, BP_VAR_R);
    2331             :                         }
    2332           3 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    2333           2 :                                 HANDLE_EXCEPTION();
    2334             :                         }
    2335           1 :                         zend_throw_error(NULL, "Class name must be a valid object or a string");
    2336             :                 }
    2337             : 
    2338        1139 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2339             :         }
    2340             : }
    2341             : 
    2342       13830 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2343             : {
    2344       13830 :         USE_OPLINE
    2345             :         zend_function *fbc;
    2346             :         zval *function_name, *func;
    2347             :         zend_string *lcname;
    2348             : 
    2349             :         zend_class_entry *called_scope;
    2350             :         zend_object *object;
    2351             :         zend_execute_data *call;
    2352       13830 :         uint32_t call_info = ZEND_CALL_NESTED_FUNCTION;
    2353             : 
    2354             :         SAVE_OPLINE();
    2355       27660 :         function_name = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    2356             : 
    2357             : try_function_name:
    2358       13834 :         if (IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
    2359             :                 const char *colon;
    2360             : 
    2361       26622 :                 if ((colon = zend_memrchr(Z_STRVAL_P(function_name), ':', Z_STRLEN_P(function_name))) != NULL &&
    2362          17 :                         colon > Z_STRVAL_P(function_name) &&
    2363          15 :                         *(colon-1) == ':'
    2364             :                 ) {
    2365             :                         zend_string *mname;
    2366          14 :                         size_t cname_length = colon - Z_STRVAL_P(function_name) - 1;
    2367          14 :                         size_t mname_length = Z_STRLEN_P(function_name) - cname_length - (sizeof("::") - 1);
    2368             : 
    2369          28 :                         lcname = zend_string_init(Z_STRVAL_P(function_name), cname_length, 0);
    2370             : 
    2371          14 :                         object = NULL;
    2372          14 :                         called_scope = zend_fetch_class_by_name(lcname, NULL, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    2373          14 :                         if (UNEXPECTED(called_scope == NULL)) {
    2374             :                                 zend_string_release(lcname);
    2375           3 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2376             :                         }
    2377             : 
    2378          22 :                         mname = zend_string_init(Z_STRVAL_P(function_name) + (cname_length + sizeof("::") - 1), mname_length, 0);
    2379             : 
    2380          11 :                         if (called_scope->get_static_method) {
    2381           0 :                                 fbc = called_scope->get_static_method(called_scope, mname);
    2382             :                         } else {
    2383          11 :                                 fbc = zend_std_get_static_method(called_scope, mname, NULL);
    2384             :                         }
    2385          11 :                         if (UNEXPECTED(fbc == NULL)) {
    2386           1 :                                 if (EXPECTED(!EG(exception))) {
    2387           1 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname));
    2388             :                                 }
    2389             :                                 zend_string_release(lcname);
    2390             :                                 zend_string_release(mname);
    2391             : 
    2392           1 :                                 HANDLE_EXCEPTION();
    2393             :                         }
    2394             : 
    2395             :                         zend_string_release(lcname);
    2396             :                         zend_string_release(mname);
    2397             : 
    2398          10 :                         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    2399           1 :                                 if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    2400           2 :                                         zend_error(E_DEPRECATED,
    2401             :                                                 "Non-static method %s::%s() should not be called statically",
    2402           2 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2403           1 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    2404           0 :                                                 HANDLE_EXCEPTION();
    2405             :                                         }
    2406             :                                 } else {
    2407           0 :                                         zend_throw_error(
    2408             :                                                 zend_ce_error,
    2409             :                                                 "Non-static method %s::%s() cannot be called statically",
    2410           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2411             : 
    2412           0 :                                         HANDLE_EXCEPTION();
    2413             :                                 }
    2414             :                         }
    2415             :                 } else {
    2416       13276 :                         if (Z_STRVAL_P(function_name)[0] == '\\') {
    2417           2 :                                 lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
    2418           1 :                                 zend_str_tolower_copy(ZSTR_VAL(lcname), Z_STRVAL_P(function_name) + 1, Z_STRLEN_P(function_name) - 1);
    2419             :                         } else {
    2420       13275 :                                 lcname = zend_string_tolower(Z_STR_P(function_name));
    2421             :                         }
    2422       13276 :                         if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
    2423           3 :                                 zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
    2424             :                                 zend_string_release(lcname);
    2425             : 
    2426           3 :                                 HANDLE_EXCEPTION();
    2427             :                         }
    2428             :                         zend_string_release(lcname);
    2429             : 
    2430       13273 :                         fbc = Z_FUNC_P(func);
    2431       13273 :                         called_scope = NULL;
    2432       13273 :                         object = NULL;
    2433             :                 }
    2434             : 
    2435        2080 :         } else if (IS_CV != IS_CONST &&
    2436         544 :             EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
    2437         512 :                 Z_OBJ_HANDLER_P(function_name, get_closure) &&
    2438         512 :                 Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
    2439         512 :                 if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
    2440             :                         /* Delay closure destruction until its invocation */
    2441             :                         ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
    2442         502 :                         GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
    2443         502 :                         call_info |= ZEND_CALL_CLOSURE;
    2444          10 :                 } else if (object) {
    2445           9 :                         call_info |= ZEND_CALL_RELEASE_THIS;
    2446           9 :                         GC_REFCOUNT(object)++; /* For $this pointer */
    2447             :                 }
    2448             : 
    2449          76 :         } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
    2450          25 :                         zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
    2451             :                 zval *obj;
    2452             :                 zval *method;
    2453          25 :                 obj = zend_hash_index_find(Z_ARRVAL_P(function_name), 0);
    2454          25 :                 method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1);
    2455             : 
    2456          25 :                 if (!obj || !method) {
    2457           1 :                         zend_throw_error(NULL, "Array callback has to contain indices 0 and 1");
    2458             : 
    2459           1 :                         HANDLE_EXCEPTION();
    2460             :                 }
    2461             : 
    2462          24 :                 ZVAL_DEREF(obj);
    2463          35 :                 if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) {
    2464           0 :                         zend_throw_error(NULL, "First array member is not a valid class name or object");
    2465             : 
    2466           0 :                         HANDLE_EXCEPTION();
    2467             :                 }
    2468             : 
    2469          24 :                 ZVAL_DEREF(method);
    2470          24 :                 if (Z_TYPE_P(method) != IS_STRING) {
    2471           0 :                         zend_throw_error(NULL, "Second array member is not a valid method");
    2472             : 
    2473           0 :                         HANDLE_EXCEPTION();
    2474             :                 }
    2475             : 
    2476          24 :                 if (Z_TYPE_P(obj) == IS_STRING) {
    2477          13 :                         object = NULL;
    2478          13 :                         called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    2479          13 :                         if (UNEXPECTED(called_scope == NULL)) {
    2480           4 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2481             :                         }
    2482             : 
    2483           9 :                         if (called_scope->get_static_method) {
    2484           0 :                                 fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
    2485             :                         } else {
    2486           9 :                                 fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
    2487             :                         }
    2488           9 :                         if (UNEXPECTED(fbc == NULL)) {
    2489           1 :                                 if (EXPECTED(!EG(exception))) {
    2490           1 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method));
    2491             :                                 }
    2492             : 
    2493           1 :                                 HANDLE_EXCEPTION();
    2494             :                         }
    2495           8 :                         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    2496           2 :                                 if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    2497           4 :                                         zend_error(E_DEPRECATED,
    2498             :                                                 "Non-static method %s::%s() should not be called statically",
    2499           4 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2500           2 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    2501           0 :                                                 HANDLE_EXCEPTION();
    2502             :                                         }
    2503             :                                 } else {
    2504           0 :                                         zend_throw_error(
    2505             :                                                 zend_ce_error,
    2506             :                                                 "Non-static method %s::%s() cannot be called statically",
    2507           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2508             : 
    2509           0 :                                         HANDLE_EXCEPTION();
    2510             :                                 }
    2511             :                         }
    2512             :                 } else {
    2513          11 :                         called_scope = Z_OBJCE_P(obj);
    2514          11 :                         object = Z_OBJ_P(obj);
    2515             : 
    2516          11 :                         fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
    2517          11 :                         if (UNEXPECTED(fbc == NULL)) {
    2518           0 :                                 if (EXPECTED(!EG(exception))) {
    2519           0 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method));
    2520             :                                 }
    2521             : 
    2522           0 :                                 HANDLE_EXCEPTION();
    2523             :                         }
    2524             : 
    2525          11 :                         if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
    2526           2 :                                 object = NULL;
    2527             :                         } else {
    2528           9 :                                 call_info |= ZEND_CALL_RELEASE_THIS;
    2529           9 :                                 GC_REFCOUNT(object)++; /* For $this pointer */
    2530             :                         }
    2531             :                 }
    2532             : 
    2533           7 :         } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
    2534           4 :                 function_name = Z_REFVAL_P(function_name);
    2535           4 :                 goto try_function_name;
    2536             :         } else {
    2537           3 :                 if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    2538           3 :                         GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    2539             :                 }
    2540           3 :                 if (UNEXPECTED(EG(exception) != NULL)) {
    2541           2 :                         HANDLE_EXCEPTION();
    2542             :                 }
    2543           1 :                 zend_throw_error(NULL, "Function name must be a string");
    2544             : 
    2545           1 :                 HANDLE_EXCEPTION();
    2546             :         }
    2547       27628 :         call = zend_vm_stack_push_call_frame(call_info,
    2548             :                 fbc, opline->extended_value, called_scope, object);
    2549       13814 :         call->prev_execute_data = EX(call);
    2550       13814 :         EX(call) = call;
    2551             : 
    2552       13814 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2553             : }
    2554             : 
    2555          21 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2556             : {
    2557          21 :         USE_OPLINE
    2558             : 
    2559             :         SAVE_OPLINE();
    2560          21 :         if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) {
    2561             :                 Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(NULL, opline->extended_value);
    2562             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2563             :         } else {
    2564             :                 zend_free_op free_op2;
    2565          42 :                 zval *class_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
    2566             : 
    2567             : try_class_name:
    2568          21 :                 if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
    2569             :                         zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
    2570             : 
    2571             :                         if (UNEXPECTED(ce == NULL)) {
    2572             :                                 ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
    2573             :                                 CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
    2574             :                         }
    2575             :                         Z_CE_P(EX_VAR(opline->result.var)) = ce;
    2576          21 :                 } else if (Z_TYPE_P(class_name) == IS_OBJECT) {
    2577           6 :                         Z_CE_P(EX_VAR(opline->result.var)) = Z_OBJCE_P(class_name);
    2578          15 :                 } else if (Z_TYPE_P(class_name) == IS_STRING) {
    2579          15 :                         Z_CE_P(EX_VAR(opline->result.var)) = zend_fetch_class(Z_STR_P(class_name), opline->extended_value);
    2580           0 :                 } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(class_name) == IS_REFERENCE) {
    2581           0 :                         class_name = Z_REFVAL_P(class_name);
    2582           0 :                         goto try_class_name;
    2583             :                 } else {
    2584           0 :                         if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(class_name) == IS_UNDEF)) {
    2585             :                                 GET_OP2_UNDEF_CV(class_name, BP_VAR_R);
    2586             :                         }
    2587           0 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    2588           0 :                                 HANDLE_EXCEPTION();
    2589             :                         }
    2590           0 :                         zend_throw_error(NULL, "Class name must be a valid object or a string");
    2591             :                 }
    2592             : 
    2593          21 :                 zval_ptr_dtor_nogc(free_op2);
    2594          21 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2595             :         }
    2596             : }
    2597             : 
    2598          80 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2599             : {
    2600          80 :         USE_OPLINE
    2601             :         zend_function *fbc;
    2602             :         zval *function_name, *func;
    2603             :         zend_string *lcname;
    2604             :         zend_free_op free_op2;
    2605             :         zend_class_entry *called_scope;
    2606             :         zend_object *object;
    2607             :         zend_execute_data *call;
    2608          80 :         uint32_t call_info = ZEND_CALL_NESTED_FUNCTION;
    2609             : 
    2610             :         SAVE_OPLINE();
    2611         160 :         function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
    2612             : 
    2613             : try_function_name:
    2614          82 :         if ((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
    2615             :                 const char *colon;
    2616             : 
    2617          96 :                 if ((colon = zend_memrchr(Z_STRVAL_P(function_name), ':', Z_STRLEN_P(function_name))) != NULL &&
    2618           0 :                         colon > Z_STRVAL_P(function_name) &&
    2619           0 :                         *(colon-1) == ':'
    2620             :                 ) {
    2621             :                         zend_string *mname;
    2622           0 :                         size_t cname_length = colon - Z_STRVAL_P(function_name) - 1;
    2623           0 :                         size_t mname_length = Z_STRLEN_P(function_name) - cname_length - (sizeof("::") - 1);
    2624             : 
    2625           0 :                         lcname = zend_string_init(Z_STRVAL_P(function_name), cname_length, 0);
    2626             : 
    2627           0 :                         object = NULL;
    2628           0 :                         called_scope = zend_fetch_class_by_name(lcname, NULL, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    2629           0 :                         if (UNEXPECTED(called_scope == NULL)) {
    2630             :                                 zend_string_release(lcname);
    2631           0 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2632             :                         }
    2633             : 
    2634           0 :                         mname = zend_string_init(Z_STRVAL_P(function_name) + (cname_length + sizeof("::") - 1), mname_length, 0);
    2635             : 
    2636           0 :                         if (called_scope->get_static_method) {
    2637           0 :                                 fbc = called_scope->get_static_method(called_scope, mname);
    2638             :                         } else {
    2639           0 :                                 fbc = zend_std_get_static_method(called_scope, mname, NULL);
    2640             :                         }
    2641           0 :                         if (UNEXPECTED(fbc == NULL)) {
    2642           0 :                                 if (EXPECTED(!EG(exception))) {
    2643           0 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), ZSTR_VAL(mname));
    2644             :                                 }
    2645             :                                 zend_string_release(lcname);
    2646             :                                 zend_string_release(mname);
    2647           0 :                                 zval_ptr_dtor_nogc(free_op2);
    2648           0 :                                 HANDLE_EXCEPTION();
    2649             :                         }
    2650             : 
    2651             :                         zend_string_release(lcname);
    2652             :                         zend_string_release(mname);
    2653             : 
    2654           0 :                         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    2655           0 :                                 if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    2656           0 :                                         zend_error(E_DEPRECATED,
    2657             :                                                 "Non-static method %s::%s() should not be called statically",
    2658           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2659           0 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    2660           0 :                                                 HANDLE_EXCEPTION();
    2661             :                                         }
    2662             :                                 } else {
    2663           0 :                                         zend_throw_error(
    2664             :                                                 zend_ce_error,
    2665             :                                                 "Non-static method %s::%s() cannot be called statically",
    2666           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2667           0 :                                         zval_ptr_dtor_nogc(free_op2);
    2668           0 :                                         HANDLE_EXCEPTION();
    2669             :                                 }
    2670             :                         }
    2671             :                 } else {
    2672          48 :                         if (Z_STRVAL_P(function_name)[0] == '\\') {
    2673           0 :                                 lcname = zend_string_alloc(Z_STRLEN_P(function_name) - 1, 0);
    2674           0 :                                 zend_str_tolower_copy(ZSTR_VAL(lcname), Z_STRVAL_P(function_name) + 1, Z_STRLEN_P(function_name) - 1);
    2675             :                         } else {
    2676          48 :                                 lcname = zend_string_tolower(Z_STR_P(function_name));
    2677             :                         }
    2678          48 :                         if (UNEXPECTED((func = zend_hash_find(EG(function_table), lcname)) == NULL)) {
    2679           0 :                                 zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
    2680             :                                 zend_string_release(lcname);
    2681           0 :                                 zval_ptr_dtor_nogc(free_op2);
    2682           0 :                                 HANDLE_EXCEPTION();
    2683             :                         }
    2684             :                         zend_string_release(lcname);
    2685             : 
    2686          48 :                         fbc = Z_FUNC_P(func);
    2687          48 :                         called_scope = NULL;
    2688          48 :                         object = NULL;
    2689             :                 }
    2690          48 :                 zval_ptr_dtor_nogc(free_op2);
    2691         115 :         } else if ((IS_TMP_VAR|IS_VAR) != IS_CONST &&
    2692          34 :             EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
    2693          27 :                 Z_OBJ_HANDLER_P(function_name, get_closure) &&
    2694          27 :                 Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &called_scope, &fbc, &object) == SUCCESS) {
    2695          27 :                 if (fbc->common.fn_flags & ZEND_ACC_CLOSURE) {
    2696             :                         /* Delay closure destruction until its invocation */
    2697             :                         ZEND_ASSERT(GC_TYPE((zend_object*)fbc->common.prototype) == IS_OBJECT);
    2698          26 :                         GC_REFCOUNT((zend_object*)fbc->common.prototype)++;
    2699          26 :                         call_info |= ZEND_CALL_CLOSURE;
    2700           1 :                 } else if (object) {
    2701           1 :                         call_info |= ZEND_CALL_RELEASE_THIS;
    2702           1 :                         GC_REFCOUNT(object)++; /* For $this pointer */
    2703             :                 }
    2704          27 :                 zval_ptr_dtor_nogc(free_op2);
    2705          15 :         } else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
    2706           4 :                         zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
    2707             :                 zval *obj;
    2708             :                 zval *method;
    2709           4 :                 obj = zend_hash_index_find(Z_ARRVAL_P(function_name), 0);
    2710           4 :                 method = zend_hash_index_find(Z_ARRVAL_P(function_name), 1);
    2711             : 
    2712           4 :                 if (!obj || !method) {
    2713           0 :                         zend_throw_error(NULL, "Array callback has to contain indices 0 and 1");
    2714           0 :                         zval_ptr_dtor_nogc(free_op2);
    2715           0 :                         HANDLE_EXCEPTION();
    2716             :                 }
    2717             : 
    2718           4 :                 ZVAL_DEREF(obj);
    2719           5 :                 if (Z_TYPE_P(obj) != IS_STRING && Z_TYPE_P(obj) != IS_OBJECT) {
    2720           0 :                         zend_throw_error(NULL, "First array member is not a valid class name or object");
    2721           0 :                         zval_ptr_dtor_nogc(free_op2);
    2722           0 :                         HANDLE_EXCEPTION();
    2723             :                 }
    2724             : 
    2725           4 :                 ZVAL_DEREF(method);
    2726           4 :                 if (Z_TYPE_P(method) != IS_STRING) {
    2727           0 :                         zend_throw_error(NULL, "Second array member is not a valid method");
    2728           0 :                         zval_ptr_dtor_nogc(free_op2);
    2729           0 :                         HANDLE_EXCEPTION();
    2730             :                 }
    2731             : 
    2732           4 :                 if (Z_TYPE_P(obj) == IS_STRING) {
    2733           3 :                         object = NULL;
    2734           3 :                         called_scope = zend_fetch_class_by_name(Z_STR_P(obj), NULL, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    2735           3 :                         if (UNEXPECTED(called_scope == NULL)) {
    2736           0 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2737             :                         }
    2738             : 
    2739           3 :                         if (called_scope->get_static_method) {
    2740           0 :                                 fbc = called_scope->get_static_method(called_scope, Z_STR_P(method));
    2741             :                         } else {
    2742           3 :                                 fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL);
    2743             :                         }
    2744           3 :                         if (UNEXPECTED(fbc == NULL)) {
    2745           0 :                                 if (EXPECTED(!EG(exception))) {
    2746           0 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(called_scope->name), Z_STRVAL_P(method));
    2747             :                                 }
    2748           0 :                                 zval_ptr_dtor_nogc(free_op2);
    2749           0 :                                 HANDLE_EXCEPTION();
    2750             :                         }
    2751           3 :                         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    2752           0 :                                 if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    2753           0 :                                         zend_error(E_DEPRECATED,
    2754             :                                                 "Non-static method %s::%s() should not be called statically",
    2755           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2756           0 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    2757           0 :                                                 HANDLE_EXCEPTION();
    2758             :                                         }
    2759             :                                 } else {
    2760           0 :                                         zend_throw_error(
    2761             :                                                 zend_ce_error,
    2762             :                                                 "Non-static method %s::%s() cannot be called statically",
    2763           0 :                                                 ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    2764           0 :                                         zval_ptr_dtor_nogc(free_op2);
    2765           0 :                                         HANDLE_EXCEPTION();
    2766             :                                 }
    2767             :                         }
    2768             :                 } else {
    2769           1 :                         called_scope = Z_OBJCE_P(obj);
    2770           1 :                         object = Z_OBJ_P(obj);
    2771             : 
    2772           1 :                         fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL);
    2773           1 :                         if (UNEXPECTED(fbc == NULL)) {
    2774           0 :                                 if (EXPECTED(!EG(exception))) {
    2775           0 :                                         zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(object->ce->name), Z_STRVAL_P(method));
    2776             :                                 }
    2777           0 :                                 zval_ptr_dtor_nogc(free_op2);
    2778           0 :                                 HANDLE_EXCEPTION();
    2779             :                         }
    2780             : 
    2781           1 :                         if ((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) {
    2782           1 :                                 object = NULL;
    2783             :                         } else {
    2784           0 :                                 call_info |= ZEND_CALL_RELEASE_THIS;
    2785           0 :                                 GC_REFCOUNT(object)++; /* For $this pointer */
    2786             :                         }
    2787             :                 }
    2788           4 :                 zval_ptr_dtor_nogc(free_op2);
    2789           3 :         } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
    2790           2 :                 function_name = Z_REFVAL_P(function_name);
    2791           2 :                 goto try_function_name;
    2792             :         } else {
    2793           1 :                 if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    2794             :                         GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    2795             :                 }
    2796           1 :                 if (UNEXPECTED(EG(exception) != NULL)) {
    2797           0 :                         HANDLE_EXCEPTION();
    2798             :                 }
    2799           1 :                 zend_throw_error(NULL, "Function name must be a string");
    2800           1 :                 zval_ptr_dtor_nogc(free_op2);
    2801           1 :                 HANDLE_EXCEPTION();
    2802             :         }
    2803         158 :         call = zend_vm_stack_push_call_frame(call_info,
    2804             :                 fbc, opline->extended_value, called_scope, object);
    2805          79 :         call->prev_execute_data = EX(call);
    2806          79 :         EX(call) = call;
    2807             : 
    2808          79 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2809             : }
    2810             : 
    2811           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2812             : {
    2813           0 :         USE_OPLINE
    2814             : 
    2815             : 
    2816             :         SAVE_OPLINE();
    2817           0 :         bitwise_not_function(EX_VAR(opline->result.var),
    2818           0 :                 EX_CONSTANT(opline->op1));
    2819             : 
    2820           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2821             : }
    2822             : 
    2823           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2824             : {
    2825           0 :         USE_OPLINE
    2826             :         zval *val;
    2827             : 
    2828             : 
    2829           0 :         val = EX_CONSTANT(opline->op1);
    2830           0 :         if (Z_TYPE_INFO_P(val) == IS_TRUE) {
    2831           0 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    2832           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    2833           0 :                 ZVAL_TRUE(EX_VAR(opline->result.var));
    2834           0 :                 if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    2835             :                         SAVE_OPLINE();
    2836           0 :                         GET_OP1_UNDEF_CV(val, BP_VAR_R);
    2837           0 :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2838             :                 }
    2839             :         } else {
    2840             :                 SAVE_OPLINE();
    2841           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), !i_zend_is_true(val));
    2842             : 
    2843           0 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2844             :         }
    2845           0 :         ZEND_VM_NEXT_OPCODE();
    2846             : }
    2847             : 
    2848       49944 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2849             : {
    2850       49944 :         USE_OPLINE
    2851             : 
    2852             :         zval *z;
    2853             : 
    2854             :         SAVE_OPLINE();
    2855       49944 :         z = EX_CONSTANT(opline->op1);
    2856             : 
    2857       49944 :         if (Z_TYPE_P(z) == IS_STRING) {
    2858       49894 :                 zend_string *str = Z_STR_P(z);
    2859             : 
    2860       49894 :                 if (ZSTR_LEN(str) != 0) {
    2861       49891 :                         zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
    2862             :                 }
    2863             :         } else {
    2864          50 :                 zend_string *str = _zval_get_string_func(z);
    2865             : 
    2866          50 :                 if (ZSTR_LEN(str) != 0) {
    2867          50 :                         zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
    2868           0 :                 } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(z) == IS_UNDEF)) {
    2869             :                         GET_OP1_UNDEF_CV(z, BP_VAR_R);
    2870             :                 }
    2871             :                 zend_string_release(str);
    2872             :         }
    2873             : 
    2874       49942 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2875             : }
    2876             : 
    2877         843 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2878             : {
    2879         843 :         USE_OPLINE
    2880             : 
    2881             :         zval *val;
    2882             : 
    2883         843 :         val = EX_CONSTANT(opline->op1);
    2884             : 
    2885         843 :         if (Z_TYPE_INFO_P(val) == IS_TRUE) {
    2886         204 :                 ZEND_VM_SET_NEXT_OPCODE(opline + 1);
    2887         204 :                 ZEND_VM_CONTINUE();
    2888         639 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    2889         359 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    2890             :                         SAVE_OPLINE();
    2891             :                         GET_OP1_UNDEF_CV(val, BP_VAR_R);
    2892             :                         ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    2893             :                 } else {
    2894         359 :                         ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
    2895         359 :                         ZEND_VM_CONTINUE();
    2896             :                 }
    2897             :         }
    2898             : 
    2899             :         SAVE_OPLINE();
    2900         280 :         if (i_zend_is_true(val)) {
    2901         117 :                 opline++;
    2902             :         } else {
    2903         163 :                 opline = OP_JMP_ADDR(opline, opline->op2);
    2904             :         }
    2905             : 
    2906         280 :         if (UNEXPECTED(EG(exception) != NULL)) {
    2907           0 :                 HANDLE_EXCEPTION();
    2908             :         }
    2909         280 :         ZEND_VM_JMP(opline);
    2910             : }
    2911             : 
    2912     6070980 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2913             : {
    2914     6070980 :         USE_OPLINE
    2915             : 
    2916             :         zval *val;
    2917             : 
    2918     6070980 :         val = EX_CONSTANT(opline->op1);
    2919             : 
    2920     6070980 :         if (Z_TYPE_INFO_P(val) == IS_TRUE) {
    2921     6070524 :                 ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
    2922     6070524 :                 ZEND_VM_CONTINUE();
    2923         456 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    2924           3 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    2925             :                         SAVE_OPLINE();
    2926             :                         GET_OP1_UNDEF_CV(val, BP_VAR_R);
    2927             :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    2928             :                 } else {
    2929           3 :                         ZEND_VM_NEXT_OPCODE();
    2930             :                 }
    2931             :         }
    2932             : 
    2933             :         SAVE_OPLINE();
    2934         453 :         if (i_zend_is_true(val)) {
    2935         452 :                 opline = OP_JMP_ADDR(opline, opline->op2);
    2936             :         } else {
    2937           1 :                 opline++;
    2938             :         }
    2939             : 
    2940         453 :         if (UNEXPECTED(EG(exception) != NULL)) {
    2941           0 :                 HANDLE_EXCEPTION();
    2942             :         }
    2943         453 :         ZEND_VM_JMP(opline);
    2944             : }
    2945             : 
    2946           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2947             : {
    2948           0 :         USE_OPLINE
    2949             : 
    2950             :         zval *val;
    2951             : 
    2952           0 :         val = EX_CONSTANT(opline->op1);
    2953             : 
    2954           0 :         if (EXPECTED(Z_TYPE_INFO_P(val) == IS_TRUE)) {
    2955           0 :                 ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
    2956           0 :                 ZEND_VM_CONTINUE();
    2957           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    2958           0 :                 if (IS_CONST == IS_CV) {
    2959             :                         if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    2960             :                                 SAVE_OPLINE();
    2961             :                                 GET_OP1_UNDEF_CV(val, BP_VAR_R);
    2962             :                         }
    2963             :                         ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    2964             :                 } else {
    2965           0 :                         ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
    2966           0 :                         ZEND_VM_CONTINUE();
    2967             :                 }
    2968             :         }
    2969             : 
    2970             :         SAVE_OPLINE();
    2971           0 :         if (i_zend_is_true(val)) {
    2972           0 :                 opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
    2973             :         } else {
    2974           0 :                 opline = OP_JMP_ADDR(opline, opline->op2);
    2975             :         }
    2976             : 
    2977           0 :         if (UNEXPECTED(EG(exception) != NULL)) {
    2978           0 :                 HANDLE_EXCEPTION();
    2979             :         }
    2980           0 :         ZEND_VM_JMP(opline);
    2981             : }
    2982             : 
    2983           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    2984             : {
    2985           0 :         USE_OPLINE
    2986             : 
    2987             :         zval *val;
    2988             :         int ret;
    2989             : 
    2990           0 :         val = EX_CONSTANT(opline->op1);
    2991             : 
    2992           0 :         if (Z_TYPE_INFO_P(val) == IS_TRUE) {
    2993           0 :                 ZVAL_TRUE(EX_VAR(opline->result.var));
    2994           0 :                 ZEND_VM_SET_NEXT_OPCODE(opline + 1);
    2995           0 :                 ZEND_VM_CONTINUE();
    2996           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    2997           0 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    2998           0 :                 if (IS_CONST == IS_CV) {
    2999             :                         if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    3000             :                                 SAVE_OPLINE();
    3001             :                                 GET_OP1_UNDEF_CV(val, BP_VAR_R);
    3002             :                         }
    3003             :                         ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3004             :                 } else {
    3005           0 :                         ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
    3006           0 :                         ZEND_VM_CONTINUE();
    3007             :                 }
    3008             :         }
    3009             : 
    3010             :         SAVE_OPLINE();
    3011           0 :         ret = i_zend_is_true(val);
    3012             : 
    3013           0 :         if (ret) {
    3014           0 :                 ZVAL_TRUE(EX_VAR(opline->result.var));
    3015           0 :                 opline++;
    3016             :         } else {
    3017           0 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    3018           0 :                 opline = OP_JMP_ADDR(opline, opline->op2);
    3019             :         }
    3020           0 :         if (UNEXPECTED(EG(exception) != NULL)) {
    3021           0 :                 HANDLE_EXCEPTION();
    3022             :         }
    3023           0 :         ZEND_VM_JMP(opline);
    3024             : }
    3025             : 
    3026           7 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3027             : {
    3028           7 :         USE_OPLINE
    3029             : 
    3030             :         zval *val;
    3031             :         int ret;
    3032             : 
    3033           7 :         val = EX_CONSTANT(opline->op1);
    3034             : 
    3035           7 :         if (Z_TYPE_INFO_P(val) == IS_TRUE) {
    3036           7 :                 ZVAL_TRUE(EX_VAR(opline->result.var));
    3037           7 :                 ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
    3038           7 :                 ZEND_VM_CONTINUE();
    3039           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    3040           0 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    3041           0 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    3042             :                         SAVE_OPLINE();
    3043             :                         GET_OP1_UNDEF_CV(val, BP_VAR_R);
    3044             :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3045             :                 } else {
    3046           0 :                         ZEND_VM_NEXT_OPCODE();
    3047             :                 }
    3048             :         }
    3049             : 
    3050             :         SAVE_OPLINE();
    3051           0 :         ret = i_zend_is_true(val);
    3052             : 
    3053           0 :         if (ret) {
    3054           0 :                 ZVAL_TRUE(EX_VAR(opline->result.var));
    3055           0 :                 opline = OP_JMP_ADDR(opline, opline->op2);
    3056             :         } else {
    3057           0 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    3058           0 :                 opline++;
    3059             :         }
    3060           0 :         if (UNEXPECTED(EG(exception) != NULL)) {
    3061           0 :                 HANDLE_EXCEPTION();
    3062             :         }
    3063           0 :         ZEND_VM_JMP(opline);
    3064             : }
    3065             : 
    3066      568134 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3067             : {
    3068      568134 :         USE_OPLINE
    3069             :         zval *retval_ptr;
    3070             :         zend_free_op free_op1;
    3071             : 
    3072      568134 :         retval_ptr = EX_CONSTANT(opline->op1);
    3073      568134 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
    3074             :                 SAVE_OPLINE();
    3075             :                 retval_ptr = GET_OP1_UNDEF_CV(retval_ptr, BP_VAR_R);
    3076             :                 if (EX(return_value)) {
    3077             :                         ZVAL_NULL(EX(return_value));
    3078             :                 }
    3079      568134 :         } else if (!EX(return_value)) {
    3080      323713 :                 if (IS_CONST == IS_VAR || IS_CONST == IS_TMP_VAR ) {
    3081             :                         if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
    3082             :                                 SAVE_OPLINE();
    3083             :                                 zval_dtor_func_for_ptr(Z_COUNTED_P(free_op1));
    3084             :                         }
    3085             :                 }
    3086             :         } else {
    3087             :                 if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    3088      244421 :                         ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
    3089             :                         if (IS_CONST == IS_CONST) {
    3090      244421 :                                 if (UNEXPECTED(Z_OPT_COPYABLE_P(EX(return_value)))) {
    3091          97 :                                         zval_copy_ctor_func(EX(return_value));
    3092             :                                 }
    3093             :                         }
    3094             :                 } else if (IS_CONST == IS_CV) {
    3095             :                         ZVAL_DEREF(retval_ptr);
    3096             :                         ZVAL_COPY(EX(return_value), retval_ptr);
    3097             :                 } else /* if (IS_CONST == IS_VAR) */ {
    3098             :                         if (UNEXPECTED(Z_ISREF_P(retval_ptr))) {
    3099             :                                 zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
    3100             : 
    3101             :                                 retval_ptr = Z_REFVAL_P(retval_ptr);
    3102             :                                 ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
    3103             :                                 if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
    3104             :                                         efree_size(ref, sizeof(zend_reference));
    3105             :                                 } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) {
    3106             :                                         Z_ADDREF_P(retval_ptr);
    3107             :                                 }
    3108             :                         } else {
    3109             :                                 ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
    3110             :                         }
    3111             :                 }
    3112             :         }
    3113      568134 :         ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    3114             : }
    3115             : 
    3116           6 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3117             : {
    3118           6 :         USE_OPLINE
    3119             :         zval *retval_ptr;
    3120             : 
    3121             : 
    3122             :         SAVE_OPLINE();
    3123             : 
    3124             :         do {
    3125             :                 if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR ||
    3126             :                     (IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) {
    3127             :                         /* Not supposed to happen, but we'll allow it */
    3128           6 :                         zend_error(E_NOTICE, "Only variable references should be returned by reference");
    3129             : 
    3130           6 :                         retval_ptr = EX_CONSTANT(opline->op1);
    3131           6 :                         if (!EX(return_value)) {
    3132             :                                 if (IS_CONST == IS_TMP_VAR) {
    3133             : 
    3134             :                                 }
    3135             :                         } else {
    3136           6 :                                 ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
    3137           6 :                                 Z_VAR_FLAGS_P(EX(return_value)) = IS_VAR_RET_REF;
    3138             :                                 if (IS_CONST != IS_TMP_VAR) {
    3139           6 :                                         zval_opt_copy_ctor_no_imm(EX(return_value));
    3140             :                                 }
    3141             :                         }
    3142           6 :                         break;
    3143             :                 }
    3144             : 
    3145             :                 retval_ptr = NULL;
    3146             : 
    3147             :                 if (IS_CONST == IS_VAR && UNEXPECTED(retval_ptr == NULL)) {
    3148             :                         zend_throw_error(NULL, "Cannot return string offsets by reference");
    3149             :                         HANDLE_EXCEPTION();
    3150             :                 }
    3151             : 
    3152             :                 if (IS_CONST == IS_VAR) {
    3153             :                         if (retval_ptr == &EG(uninitialized_zval) ||
    3154             :                             (opline->extended_value == ZEND_RETURNS_FUNCTION &&
    3155             :                              !(Z_VAR_FLAGS_P(retval_ptr) & IS_VAR_RET_REF))) {
    3156             :                                 zend_error(E_NOTICE, "Only variable references should be returned by reference");
    3157             :                                 if (EX(return_value)) {
    3158             :                                         ZVAL_NEW_REF(EX(return_value), retval_ptr);
    3159             :                                         Z_VAR_FLAGS_P(EX(return_value)) = IS_VAR_RET_REF;
    3160             :                                         if (Z_REFCOUNTED_P(retval_ptr)) Z_ADDREF_P(retval_ptr);
    3161             :                                 }
    3162             :                                 break;
    3163             :                         }
    3164             :                 }
    3165             : 
    3166             :                 if (EX(return_value)) {
    3167             :                         ZVAL_MAKE_REF(retval_ptr);
    3168             :                         Z_ADDREF_P(retval_ptr);
    3169             :                         ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr));
    3170             :                         Z_VAR_FLAGS_P(EX(return_value)) = IS_VAR_RET_REF;
    3171             :                 }
    3172             :         } while (0);
    3173             : 
    3174           6 :         ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    3175             : }
    3176             : 
    3177       50099 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3178             : {
    3179       50099 :         USE_OPLINE
    3180             :         zval *retval;
    3181             : 
    3182             : 
    3183       50099 :         zend_generator *generator = zend_get_running_generator(execute_data);
    3184             : 
    3185             :         SAVE_OPLINE();
    3186       50099 :         retval = EX_CONSTANT(opline->op1);
    3187             : 
    3188             :         /* Copy return value into generator->retval */
    3189             :         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    3190       50099 :                 ZVAL_COPY_VALUE(&generator->retval, retval);
    3191             :                 if (IS_CONST == IS_CONST) {
    3192       50099 :                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->retval))) {
    3193           0 :                                 zval_copy_ctor_func(&generator->retval);
    3194             :                         }
    3195             :                 }
    3196             :         } else if (IS_CONST == IS_CV) {
    3197             :                 ZVAL_DEREF(retval);
    3198             :                 ZVAL_COPY(&generator->retval, retval);
    3199             :         } else /* if (IS_CONST == IS_VAR) */ {
    3200             :                 if (UNEXPECTED(Z_ISREF_P(retval))) {
    3201             :                         zend_refcounted *ref = Z_COUNTED_P(retval);
    3202             : 
    3203             :                         retval = Z_REFVAL_P(retval);
    3204             :                         ZVAL_COPY_VALUE(&generator->retval, retval);
    3205             :                         if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
    3206             :                                 efree_size(ref, sizeof(zend_reference));
    3207             :                         } else if (Z_OPT_REFCOUNTED_P(retval)) {
    3208             :                                 Z_ADDREF_P(retval);
    3209             :                         }
    3210             :                 } else {
    3211             :                         ZVAL_COPY_VALUE(&generator->retval, retval);
    3212             :                 }
    3213             :         }
    3214             : 
    3215             :         /* Close the generator to free up resources */
    3216       50099 :         zend_generator_close(generator, 1);
    3217             : 
    3218             :         /* Pass execution back to handling code */
    3219       50099 :         ZEND_VM_RETURN();
    3220             : }
    3221             : 
    3222           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3223             : {
    3224           2 :         USE_OPLINE
    3225             :         zval *value;
    3226             : 
    3227             : 
    3228             :         SAVE_OPLINE();
    3229           2 :         value = EX_CONSTANT(opline->op1);
    3230             : 
    3231             :         do {
    3232             :                 if (IS_CONST == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
    3233           2 :                         if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) {
    3234             :                                 value = Z_REFVAL_P(value);
    3235             :                                 if (EXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
    3236             :                                         break;
    3237             :                                 }
    3238             :                         }
    3239           2 :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
    3240             :                                 GET_OP1_UNDEF_CV(value, BP_VAR_R);
    3241             :                         }
    3242           2 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    3243           0 :                                 HANDLE_EXCEPTION();
    3244             :                         }
    3245           2 :                         zend_throw_error(NULL, "Can only throw objects");
    3246             : 
    3247           2 :                         HANDLE_EXCEPTION();
    3248             :                 }
    3249             :         } while (0);
    3250             : 
    3251             :         zend_exception_save();
    3252             :         if (IS_CONST != IS_TMP_VAR) {
    3253             :                 if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    3254             :         }
    3255             : 
    3256             :         zend_throw_exception_object(value);
    3257             :         zend_exception_restore();
    3258             : 
    3259             :         HANDLE_EXCEPTION();
    3260             : }
    3261             : 
    3262     9792720 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3263             : {
    3264     9792720 :         USE_OPLINE
    3265             :         zval *value, *arg;
    3266             : 
    3267             : 
    3268     9792720 :         value = EX_CONSTANT(opline->op1);
    3269     9792720 :         arg = ZEND_CALL_VAR(EX(call), opline->result.var);
    3270     9792720 :         ZVAL_COPY_VALUE(arg, value);
    3271             :         if (IS_CONST == IS_CONST) {
    3272     9792720 :                 if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
    3273       90827 :                         zval_copy_ctor_func(arg);
    3274             :                 }
    3275             :         }
    3276     9792720 :         ZEND_VM_NEXT_OPCODE();
    3277             : }
    3278             : 
    3279      255658 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3280             : {
    3281      255658 :         USE_OPLINE
    3282             :         zval *value, *arg;
    3283             : 
    3284             : 
    3285      255658 :         if (EXPECTED(opline->op2.num <= MAX_ARG_FLAG_NUM)) {
    3286      255640 :                 if (QUICK_ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
    3287           3 :                         goto send_val_by_ref;
    3288             :                 }
    3289          36 :         } else if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
    3290             : send_val_by_ref:
    3291             :                 SAVE_OPLINE();
    3292           3 :                 zend_throw_error(NULL, "Cannot pass parameter %d by reference", opline->op2.num);
    3293             : 
    3294           3 :                 arg = ZEND_CALL_VAR(EX(call), opline->result.var);
    3295           3 :                 ZVAL_UNDEF(arg);
    3296           3 :                 HANDLE_EXCEPTION();
    3297             :         }
    3298      255655 :         value = EX_CONSTANT(opline->op1);
    3299      255655 :         arg = ZEND_CALL_VAR(EX(call), opline->result.var);
    3300      255655 :         ZVAL_COPY_VALUE(arg, value);
    3301             :         if (IS_CONST == IS_CONST) {
    3302      255655 :                 if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
    3303        1253 :                         zval_copy_ctor_func(arg);
    3304             :                 }
    3305             :         }
    3306      255655 :         ZEND_VM_NEXT_OPCODE();
    3307             : }
    3308             : 
    3309          17 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3310             : {
    3311          17 :         USE_OPLINE
    3312             :         zval *val;
    3313             : 
    3314             : 
    3315          17 :         val = EX_CONSTANT(opline->op1);
    3316          17 :         if (Z_TYPE_INFO_P(val) == IS_TRUE) {
    3317           6 :                 ZVAL_TRUE(EX_VAR(opline->result.var));
    3318          11 :         } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
    3319           9 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    3320           9 :                 if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
    3321             :                         SAVE_OPLINE();
    3322           0 :                         GET_OP1_UNDEF_CV(val, BP_VAR_R);
    3323           0 :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3324             :                 }
    3325             :         } else {
    3326             :                 SAVE_OPLINE();
    3327           4 :                 ZVAL_BOOL(EX_VAR(opline->result.var), i_zend_is_true(val));
    3328             : 
    3329           2 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3330             :         }
    3331          15 :         ZEND_VM_NEXT_OPCODE();
    3332             : }
    3333             : 
    3334      470586 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3335             : {
    3336      470586 :         USE_OPLINE
    3337             :         zval object_zval;
    3338             :         zend_function *constructor;
    3339             :         zend_class_entry *ce;
    3340             : 
    3341             :         SAVE_OPLINE();
    3342             :         if (IS_CONST == IS_CONST) {
    3343      470586 :                 ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    3344      470586 :                 if (UNEXPECTED(ce == NULL)) {
    3345       12110 :                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    3346       12108 :                         if (UNEXPECTED(ce == NULL)) {
    3347          12 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3348             :                         }
    3349       12096 :                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
    3350             :                 }
    3351             :         } else {
    3352             :                 ce = Z_CE_P(EX_VAR(opline->op1.var));
    3353             :         }
    3354      470572 :         if (UNEXPECTED(object_init_ex(&object_zval, ce) != SUCCESS)) {
    3355           6 :                 HANDLE_EXCEPTION();
    3356             :         }
    3357      470565 :         constructor = Z_OBJ_HT(object_zval)->get_constructor(Z_OBJ(object_zval));
    3358             : 
    3359      470565 :         if (constructor == NULL) {
    3360      184623 :                 if (EXPECTED(RETURN_VALUE_USED(opline))) {
    3361      184609 :                         ZVAL_COPY_VALUE(EX_VAR(opline->result.var), &object_zval);
    3362             :                 } else {
    3363          14 :                         OBJ_RELEASE(Z_OBJ(object_zval));
    3364             :                 }
    3365      184623 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3366             :         } else {
    3367             :                 /* We are not handling overloaded classes right now */
    3368      571884 :                 zend_execute_data *call = zend_vm_stack_push_call_frame(
    3369             :                                 ZEND_CALL_FUNCTION | ZEND_CALL_RELEASE_THIS | ZEND_CALL_CTOR |
    3370      285942 :                                 (EXPECTED(RETURN_VALUE_USED(opline)) ? 0 : ZEND_CALL_CTOR_RESULT_UNUSED),
    3371             :                         constructor,
    3372             :                         opline->extended_value,
    3373             :                         ce,
    3374      285942 :                         Z_OBJ(object_zval));
    3375      285942 :                 call->prev_execute_data = EX(call);
    3376      285942 :                 EX(call) = call;
    3377             : 
    3378      285942 :                 if (EXPECTED(RETURN_VALUE_USED(opline))) {
    3379      275745 :                         ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
    3380             :                 }
    3381             : 
    3382      285942 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3383             :         }
    3384             : }
    3385             : 
    3386           4 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3387             : {
    3388           4 :         USE_OPLINE
    3389             : 
    3390             :         zval *obj;
    3391             :         zend_class_entry *ce;
    3392             :         zend_function *clone;
    3393             :         zend_object_clone_obj_t clone_call;
    3394             : 
    3395             :         SAVE_OPLINE();
    3396           4 :         obj = EX_CONSTANT(opline->op1);
    3397             : 
    3398           4 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(obj) == NULL)) {
    3399             :                 zend_throw_error(NULL, "Using $this when not in object context");
    3400             :                 HANDLE_EXCEPTION();
    3401             :         }
    3402             : 
    3403             :         do {
    3404             :                 if (IS_CONST == IS_CONST ||
    3405             :                     (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
    3406           4 :                     if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(obj)) {
    3407             :                         obj = Z_REFVAL_P(obj);
    3408             :                         if (EXPECTED(Z_TYPE_P(obj) == IS_OBJECT)) {
    3409             :                                 break;
    3410             :                                 }
    3411             :                         }
    3412           4 :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) {
    3413             :                                 GET_OP1_UNDEF_CV(obj, BP_VAR_R);
    3414             :                         }
    3415           4 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    3416           0 :                                 HANDLE_EXCEPTION();
    3417             :                         }
    3418           4 :                         zend_throw_error(NULL, "__clone method called on non-object");
    3419             : 
    3420           4 :                         HANDLE_EXCEPTION();
    3421             :                 }
    3422             :         } while (0);
    3423             : 
    3424             :         ce = Z_OBJCE_P(obj);
    3425             :         clone = ce ? ce->clone : NULL;
    3426             :         clone_call =  Z_OBJ_HT_P(obj)->clone_obj;
    3427             :         if (UNEXPECTED(clone_call == NULL)) {
    3428             :                 if (ce) {
    3429             :                         zend_throw_error(NULL, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name));
    3430             :                 } else {
    3431             :                         zend_throw_error(NULL, "Trying to clone an uncloneable object");
    3432             :                 }
    3433             : 
    3434             :                 HANDLE_EXCEPTION();
    3435             :         }
    3436             : 
    3437             :         if (ce && clone) {
    3438             :                 if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
    3439             :                         /* Ensure that if we're calling a private function, we're allowed to do so.
    3440             :                          */
    3441             :                         if (UNEXPECTED(ce != EG(scope))) {
    3442             :                                 zend_throw_error(NULL, "Call to private %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
    3443             : 
    3444             :                                 HANDLE_EXCEPTION();
    3445             :                         }
    3446             :                 } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
    3447             :                         /* Ensure that if we're calling a protected function, we're allowed to do so.
    3448             :                          */
    3449             :                         if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
    3450             :                                 zend_throw_error(NULL, "Call to protected %s::__clone() from context '%s'", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "");
    3451             : 
    3452             :                                 HANDLE_EXCEPTION();
    3453             :                         }
    3454             :                 }
    3455             :         }
    3456             : 
    3457             :         if (EXPECTED(EG(exception) == NULL)) {
    3458             :                 ZVAL_OBJ(EX_VAR(opline->result.var), clone_call(obj));
    3459             :                 if (UNEXPECTED(!RETURN_VALUE_USED(opline)) || UNEXPECTED(EG(exception) != NULL)) {
    3460             :                         OBJ_RELEASE(Z_OBJ_P(EX_VAR(opline->result.var)));
    3461             :                 }
    3462             :         }
    3463             : 
    3464             :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3465             : }
    3466             : 
    3467         311 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3468             : {
    3469         311 :         USE_OPLINE
    3470             : 
    3471             :         zval *expr;
    3472         311 :         zval *result = EX_VAR(opline->result.var);
    3473             : 
    3474             :         SAVE_OPLINE();
    3475         311 :         expr = EX_CONSTANT(opline->op1);
    3476             : 
    3477         311 :         switch (opline->extended_value) {
    3478             :                 case IS_NULL:
    3479             :                         /* This code is taken from convert_to_null. However, it does not seems very useful,
    3480             :                          * because a conversion to null always results in the same value. This could only
    3481             :                          * be relevant if a cast_object handler for IS_NULL has some kind of side-effect. */
    3482             : #if 0
    3483             :                         if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
    3484             :                                 ZVAL_DEREF(expr);
    3485             :                         }
    3486             :                         if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->cast_object) {
    3487             :                                 if (Z_OBJ_HT_P(expr)->cast_object(expr, result, IS_NULL) == SUCCESS) {
    3488             :                                         break;
    3489             :                                 }
    3490             :                         }
    3491             : #endif
    3492             : 
    3493           0 :                         ZVAL_NULL(result);
    3494           0 :                         break;
    3495             :                 case _IS_BOOL:
    3496           2 :                         ZVAL_BOOL(result, zend_is_true(expr));
    3497           2 :                         break;
    3498             :                 case IS_LONG:
    3499          12 :                         ZVAL_LONG(result, zval_get_long(expr));
    3500           6 :                         break;
    3501             :                 case IS_DOUBLE:
    3502          20 :                         ZVAL_DOUBLE(result, zval_get_double(expr));
    3503          10 :                         break;
    3504             :                 case IS_STRING:
    3505         434 :                         ZVAL_STR(result, zval_get_string(expr));
    3506         217 :                         break;
    3507             :                 default:
    3508          76 :                         if (IS_CONST & (IS_VAR|IS_CV)) {
    3509             :                                 ZVAL_DEREF(expr);
    3510             :                         }
    3511             :                         /* If value is already of correct type, return it directly */
    3512          76 :                         if (Z_TYPE_P(expr) == opline->extended_value) {
    3513           0 :                                 ZVAL_COPY_VALUE(result, expr);
    3514             :                                 if (IS_CONST == IS_CONST) {
    3515           0 :                                         if (UNEXPECTED(Z_OPT_COPYABLE_P(result))) {
    3516           0 :                                                 zval_copy_ctor_func(result);
    3517             :                                         }
    3518             :                                 } else if (IS_CONST != IS_TMP_VAR) {
    3519             :                                         if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
    3520             :                                 }
    3521             : 
    3522           0 :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3523             :                         }
    3524             : 
    3525          76 :                         if (opline->extended_value == IS_ARRAY) {
    3526           5 :                                 if (Z_TYPE_P(expr) != IS_OBJECT) {
    3527           5 :                                         ZVAL_NEW_ARR(result);
    3528           5 :                                         zend_hash_init(Z_ARRVAL_P(result), 8, NULL, ZVAL_PTR_DTOR, 0);
    3529           5 :                                         if (Z_TYPE_P(expr) != IS_NULL) {
    3530           4 :                                                 expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
    3531             :                                                 if (IS_CONST == IS_CONST) {
    3532           4 :                                                         if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) {
    3533           0 :                                                                 zval_copy_ctor_func(expr);
    3534             :                                                         }
    3535             :                                                 } else {
    3536             :                                                         if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
    3537             :                                                 }
    3538             :                                         }
    3539             :                                 } else {
    3540           0 :                                         ZVAL_COPY_VALUE(result, expr);
    3541             :                                         Z_ADDREF_P(result);
    3542           0 :                                         convert_to_array(result);
    3543             :                                 }
    3544             :                         } else {
    3545          71 :                                 if (Z_TYPE_P(expr) != IS_ARRAY) {
    3546           5 :                                         object_init(result);
    3547           5 :                                         if (Z_TYPE_P(expr) != IS_NULL) {
    3548           5 :                                                 expr = zend_hash_str_add_new(Z_OBJPROP_P(result), "scalar", sizeof("scalar")-1, expr);
    3549             :                                                 if (IS_CONST == IS_CONST) {
    3550           5 :                                                         if (UNEXPECTED(Z_OPT_COPYABLE_P(expr))) {
    3551           0 :                                                                 zval_copy_ctor_func(expr);
    3552             :                                                         }
    3553             :                                                 } else {
    3554             :                                                         if (Z_OPT_REFCOUNTED_P(expr)) Z_ADDREF_P(expr);
    3555             :                                                 }
    3556             :                                         }
    3557             :                                 } else {
    3558          66 :                                         ZVAL_COPY(result, expr);
    3559          66 :                                         convert_to_object(result);
    3560             :                                 }
    3561             :                         }
    3562             :         }
    3563             : 
    3564         311 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3565             : }
    3566             : 
    3567        6024 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3568             : {
    3569        6024 :         USE_OPLINE
    3570        6024 :         zend_op_array *new_op_array=NULL;
    3571             : 
    3572             :         zval *inc_filename;
    3573             :         zval tmp_inc_filename;
    3574        6024 :         zend_bool failure_retval=0;
    3575             : 
    3576             :         SAVE_OPLINE();
    3577        6024 :         inc_filename = EX_CONSTANT(opline->op1);
    3578             : 
    3579        6024 :         ZVAL_UNDEF(&tmp_inc_filename);
    3580        6024 :         if (Z_TYPE_P(inc_filename) != IS_STRING) {
    3581           0 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(inc_filename) == IS_UNDEF)) {
    3582             :                         inc_filename = GET_OP1_UNDEF_CV(inc_filename, BP_VAR_R);
    3583             :                 }
    3584           0 :                 ZVAL_STR(&tmp_inc_filename, zval_get_string(inc_filename));
    3585           0 :                 inc_filename = &tmp_inc_filename;
    3586             :         }
    3587             : 
    3588        6024 :         if (opline->extended_value != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
    3589           0 :                 if (opline->extended_value == ZEND_INCLUDE_ONCE || opline->extended_value == ZEND_INCLUDE) {
    3590           0 :                         zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
    3591             :                 } else {
    3592           0 :                         zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
    3593             :                 }
    3594             :         } else {
    3595        6024 :                 switch (opline->extended_value) {
    3596             :                         case ZEND_INCLUDE_ONCE:
    3597             :                         case ZEND_REQUIRE_ONCE: {
    3598             :                                         zend_file_handle file_handle;
    3599             :                                         zend_string *resolved_path;
    3600             : 
    3601        3875 :                                         resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename));
    3602        3875 :                                         if (resolved_path) {
    3603        3871 :                                                 failure_retval = zend_hash_exists(&EG(included_files), resolved_path);
    3604             :                                         } else {
    3605           8 :                                                 resolved_path = zend_string_copy(Z_STR_P(inc_filename));
    3606             :                                         }
    3607             : 
    3608        3875 :                                         if (failure_retval) {
    3609             :                                                 /* do nothing, file already included */
    3610        3322 :                                         } else if (SUCCESS == zend_stream_open(ZSTR_VAL(resolved_path), &file_handle)) {
    3611             : 
    3612        3320 :                                                 if (!file_handle.opened_path) {
    3613           4 :                                                         file_handle.opened_path = zend_string_copy(resolved_path);
    3614             :                                                 }
    3615             : 
    3616        3320 :                                                 if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path)) {
    3617        3319 :                                                         new_op_array = zend_compile_file(&file_handle, (opline->extended_value==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE));
    3618        3319 :                                                         zend_destroy_file_handle(&file_handle);
    3619             :                                                 } else {
    3620           1 :                                                         zend_file_handle_dtor(&file_handle);
    3621           1 :                                                         failure_retval=1;
    3622             :                                                 }
    3623             :                                         } else {
    3624           2 :                                                 if (opline->extended_value == ZEND_INCLUDE_ONCE) {
    3625           0 :                                                         zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
    3626             :                                                 } else {
    3627           2 :                                                         zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
    3628             :                                                 }
    3629             :                                         }
    3630             :                                         zend_string_release(resolved_path);
    3631             :                                 }
    3632        3873 :                                 break;
    3633             :                         case ZEND_INCLUDE:
    3634             :                         case ZEND_REQUIRE:
    3635        2082 :                                 new_op_array = compile_filename(opline->extended_value, inc_filename);
    3636        2080 :                                 break;
    3637             :                         case ZEND_EVAL: {
    3638          67 :                                         char *eval_desc = zend_make_compiled_string_description("eval()'d code");
    3639             : 
    3640          67 :                                         new_op_array = zend_compile_string(inc_filename, eval_desc);
    3641          65 :                                         efree(eval_desc);
    3642             :                                 }
    3643             :                                 break;
    3644             :                         EMPTY_SWITCH_DEFAULT_CASE()
    3645             :                 }
    3646             :         }
    3647        6018 :         if (Z_TYPE(tmp_inc_filename) != IS_UNDEF) {
    3648           0 :                 zend_string_release(Z_STR(tmp_inc_filename));
    3649             :         }
    3650             : 
    3651        6018 :         if (UNEXPECTED(EG(exception) != NULL)) {
    3652           4 :                 HANDLE_EXCEPTION();
    3653        6014 :         } else if (EXPECTED(new_op_array != NULL)) {
    3654        5449 :                 zval *return_value = NULL;
    3655             :                 zend_execute_data *call;
    3656             : 
    3657        5449 :                 if (RETURN_VALUE_USED(opline)) {
    3658           0 :                         return_value = EX_VAR(opline->result.var);
    3659             :                 }
    3660             : 
    3661        5449 :                 new_op_array->scope = EG(scope);
    3662             : 
    3663       10898 :                 call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_CODE,
    3664             :                         (zend_function*)new_op_array, 0, EX(called_scope), Z_OBJ(EX(This)));
    3665             : 
    3666        5449 :                 if (EX(symbol_table)) {
    3667        5415 :                         call->symbol_table = EX(symbol_table);
    3668             :                 } else {
    3669          34 :                         call->symbol_table = zend_rebuild_symbol_table();
    3670             :                 }
    3671             : 
    3672        5449 :                 call->prev_execute_data = execute_data;
    3673             :             i_init_code_execute_data(call, new_op_array, return_value);
    3674        5449 :                 if (EXPECTED(zend_execute_ex == execute_ex)) {
    3675        5449 :                         ZEND_VM_ENTER();
    3676             :                 } else {
    3677           0 :                         ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP);
    3678           0 :                         zend_execute_ex(call);
    3679             :                         zend_vm_stack_free_call_frame(call);
    3680             :                 }
    3681             : 
    3682           0 :                 destroy_op_array(new_op_array);
    3683           0 :                 efree_size(new_op_array, sizeof(zend_op_array));
    3684           0 :                 if (UNEXPECTED(EG(exception) != NULL)) {
    3685           0 :                         zend_throw_exception_internal(NULL);
    3686           0 :                         HANDLE_EXCEPTION();
    3687             :                 }
    3688             : 
    3689         565 :         } else if (RETURN_VALUE_USED(opline)) {
    3690           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), failure_retval);
    3691             :         }
    3692             :         ZEND_VM_INTERRUPT_CHECK();
    3693         565 :         ZEND_VM_NEXT_OPCODE();
    3694             : }
    3695             : 
    3696       13961 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3697             : {
    3698       13961 :         USE_OPLINE
    3699             : 
    3700             :         zval *array_ptr, *result;
    3701             :         HashTable *fe_ht;
    3702             : 
    3703             :         SAVE_OPLINE();
    3704             : 
    3705       13961 :         array_ptr = EX_CONSTANT(opline->op1);
    3706       13961 :         if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) {
    3707       13961 :                 result = EX_VAR(opline->result.var);
    3708       13961 :                 ZVAL_COPY_VALUE(result, array_ptr);
    3709       13961 :                 if (IS_CONST != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(result)) {
    3710             :                         Z_ADDREF_P(array_ptr);
    3711             :                 }
    3712       13961 :                 Z_FE_POS_P(result) = 0;
    3713             : 
    3714       13961 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3715           0 :         } else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
    3716             :                 if (!Z_OBJCE_P(array_ptr)->get_iterator) {
    3717             :                         HashPosition pos = 0;
    3718             :                         Bucket *p;
    3719             : 
    3720             :                         result = EX_VAR(opline->result.var);
    3721             :                         ZVAL_COPY_VALUE(result, array_ptr);
    3722             :                         if (IS_CONST != IS_TMP_VAR) {
    3723             :                                 Z_ADDREF_P(array_ptr);
    3724             :                         }
    3725             :                         fe_ht = Z_OBJPROP_P(array_ptr);
    3726             :                         pos = 0;
    3727             :                         p = fe_ht->arData;
    3728             :                         while (1) {
    3729             :                                 if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
    3730             : 
    3731             :                                         Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3732             :                                         ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3733             :                                 }
    3734             :                                 if ((EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
    3735             :                                      (EXPECTED(Z_TYPE(p->val) != IS_INDIRECT) ||
    3736             :                                       EXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) != IS_UNDEF))) &&
    3737             :                                     (UNEXPECTED(!p->key) ||
    3738             :                                      EXPECTED(zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS))) {
    3739             :                                         break;
    3740             :                                 }
    3741             :                                 pos++;
    3742             :                                 p++;
    3743             :                         }
    3744             :                         Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(fe_ht, pos);
    3745             : 
    3746             :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3747             :                 } else {
    3748             :                         zend_class_entry *ce = Z_OBJCE_P(array_ptr);
    3749             :                         zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 0);
    3750             :                         zend_bool is_empty;
    3751             : 
    3752             :                         if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
    3753             : 
    3754             :                                 if (!EG(exception)) {
    3755             :                                         zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name));
    3756             :                                 }
    3757             :                                 zend_throw_exception_internal(NULL);
    3758             :                                 HANDLE_EXCEPTION();
    3759             :                         }
    3760             : 
    3761             :                         iter->index = 0;
    3762             :                         if (iter->funcs->rewind) {
    3763             :                                 iter->funcs->rewind(iter);
    3764             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    3765             :                                         OBJ_RELEASE(&iter->std);
    3766             : 
    3767             :                                         HANDLE_EXCEPTION();
    3768             :                                 }
    3769             :                         }
    3770             : 
    3771             :                         is_empty = iter->funcs->valid(iter) != SUCCESS;
    3772             : 
    3773             :                         if (UNEXPECTED(EG(exception) != NULL)) {
    3774             :                                 OBJ_RELEASE(&iter->std);
    3775             : 
    3776             :                                 HANDLE_EXCEPTION();
    3777             :                         }
    3778             :                         iter->index = -1; /* will be set to 0 before using next handler */
    3779             : 
    3780             :                         ZVAL_OBJ(EX_VAR(opline->result.var), &iter->std);
    3781             :                         Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3782             : 
    3783             :                         if (is_empty) {
    3784             :                                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3785             :                         } else {
    3786             :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3787             :                         }
    3788             :                 }
    3789             :         } else {
    3790           0 :                 zend_error(E_WARNING, "Invalid argument supplied for foreach()");
    3791           0 :                 ZVAL_UNDEF(EX_VAR(opline->result.var));
    3792           0 :                 Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3793             : 
    3794           0 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3795             :         }
    3796             : }
    3797             : 
    3798           3 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3799             : {
    3800           3 :         USE_OPLINE
    3801             : 
    3802             :         zval *array_ptr, *array_ref;
    3803             :         HashTable *fe_ht;
    3804           3 :         HashPosition pos = 0;
    3805             :         Bucket *p;
    3806             : 
    3807             :         SAVE_OPLINE();
    3808             : 
    3809           3 :         if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
    3810             :                 array_ref = array_ptr = NULL;
    3811             :                 if (Z_ISREF_P(array_ref)) {
    3812             :                         array_ptr = Z_REFVAL_P(array_ref);
    3813             :                 }
    3814             :         } else {
    3815           3 :                 array_ref = array_ptr = EX_CONSTANT(opline->op1);
    3816             :         }
    3817             : 
    3818           3 :         if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) {
    3819           3 :                 if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
    3820             :                         if (array_ptr == array_ref) {
    3821             :                                 ZVAL_NEW_REF(array_ref, array_ref);
    3822             :                                 array_ptr = Z_REFVAL_P(array_ref);
    3823             :                         }
    3824             :                         Z_ADDREF_P(array_ref);
    3825             :                         ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
    3826             :                 } else {
    3827           3 :                         array_ptr = EX_VAR(opline->result.var);
    3828           3 :                         ZVAL_COPY_VALUE(array_ptr, array_ref);
    3829             :                 }
    3830             :                 if (IS_CONST == IS_CONST) {
    3831           3 :                         zval_copy_ctor_func(array_ptr);
    3832             :                 } else {
    3833             :                         SEPARATE_ARRAY(array_ptr);
    3834             :                 }
    3835           3 :                 fe_ht = Z_ARRVAL_P(array_ptr);
    3836           3 :                 p = fe_ht->arData;
    3837             :                 while (1) {
    3838           3 :                         if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
    3839             : 
    3840           0 :                                 Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3841           0 :                                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3842             :                         }
    3843           9 :                         if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
    3844           6 :                             (EXPECTED(Z_TYPE(p->val) != IS_INDIRECT) ||
    3845           0 :                              EXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) != IS_UNDEF))) {
    3846             :                                 break;
    3847             :                         }
    3848           0 :                         pos++;
    3849           0 :                         p++;
    3850           0 :                 }
    3851           3 :                 Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(fe_ht, pos);
    3852             : 
    3853           3 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3854           0 :         } else if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(array_ptr) == IS_OBJECT)) {
    3855             :                 if (!Z_OBJCE_P(array_ptr)->get_iterator) {
    3856             :                         if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
    3857             :                                 if (array_ptr == array_ref) {
    3858             :                                         ZVAL_NEW_REF(array_ref, array_ref);
    3859             :                                         array_ptr = Z_REFVAL_P(array_ref);
    3860             :                                 }
    3861             :                                 Z_ADDREF_P(array_ref);
    3862             :                                 ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
    3863             :                         } else {
    3864             :                                 array_ptr = EX_VAR(opline->result.var);
    3865             :                                 ZVAL_COPY_VALUE(array_ptr, array_ref);
    3866             :                         }
    3867             :                         fe_ht = Z_OBJPROP_P(array_ptr);
    3868             :                         p = fe_ht->arData;
    3869             :                         while (1) {
    3870             :                                 if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
    3871             : 
    3872             :                                         Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3873             :                                         ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3874             :                                 }
    3875             :                                 if ((EXPECTED(Z_TYPE(p->val) != IS_UNDEF) &&
    3876             :                                      (EXPECTED(Z_TYPE(p->val) != IS_INDIRECT) ||
    3877             :                                       EXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) != IS_UNDEF))) &&
    3878             :                                     (UNEXPECTED(!p->key) ||
    3879             :                                      EXPECTED(zend_check_property_access(Z_OBJ_P(array_ptr), p->key) == SUCCESS))) {
    3880             :                                         break;
    3881             :                                 }
    3882             :                                 pos++;
    3883             :                                 p++;
    3884             :                         }
    3885             :                         Z_FE_ITER_P(EX_VAR(opline->result.var)) = zend_hash_iterator_add(fe_ht, pos);
    3886             : 
    3887             :                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3888             :                 } else {
    3889             :                         zend_class_entry *ce = Z_OBJCE_P(array_ptr);
    3890             :                         zend_object_iterator *iter = ce->get_iterator(ce, array_ptr, 1);
    3891             :                         zend_bool is_empty;
    3892             : 
    3893             :                         if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
    3894             :                                 if (IS_CONST == IS_VAR) {
    3895             : 
    3896             :                                 } else {
    3897             : 
    3898             :                                 }
    3899             :                                 if (!EG(exception)) {
    3900             :                                         zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name));
    3901             :                                 }
    3902             :                                 zend_throw_exception_internal(NULL);
    3903             :                                 HANDLE_EXCEPTION();
    3904             :                         }
    3905             : 
    3906             :                         iter->index = 0;
    3907             :                         if (iter->funcs->rewind) {
    3908             :                                 iter->funcs->rewind(iter);
    3909             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    3910             :                                         OBJ_RELEASE(&iter->std);
    3911             :                                         if (IS_CONST == IS_VAR) {
    3912             : 
    3913             :                                         } else {
    3914             : 
    3915             :                                         }
    3916             :                                         HANDLE_EXCEPTION();
    3917             :                                 }
    3918             :                         }
    3919             : 
    3920             :                         is_empty = iter->funcs->valid(iter) != SUCCESS;
    3921             : 
    3922             :                         if (UNEXPECTED(EG(exception) != NULL)) {
    3923             :                                 OBJ_RELEASE(&iter->std);
    3924             :                                 if (IS_CONST == IS_VAR) {
    3925             : 
    3926             :                                 } else {
    3927             : 
    3928             :                                 }
    3929             :                                 HANDLE_EXCEPTION();
    3930             :                         }
    3931             :                         iter->index = -1; /* will be set to 0 before using next handler */
    3932             : 
    3933             :                         ZVAL_OBJ(EX_VAR(opline->result.var), &iter->std);
    3934             :                         Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3935             : 
    3936             :                         if (IS_CONST == IS_VAR) {
    3937             : 
    3938             :                         } else {
    3939             : 
    3940             :                         }
    3941             :                         if (is_empty) {
    3942             :                                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3943             :                         } else {
    3944             :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    3945             :                         }
    3946             :                 }
    3947             :         } else {
    3948           0 :                 zend_error(E_WARNING, "Invalid argument supplied for foreach()");
    3949           0 :                 ZVAL_UNDEF(EX_VAR(opline->result.var));
    3950           0 :                 Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
    3951             :                 if (IS_CONST == IS_VAR) {
    3952             : 
    3953             :                 } else {
    3954             : 
    3955             :                 }
    3956           0 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    3957             :         }
    3958             : }
    3959             : 
    3960         853 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3961             : {
    3962         853 :         USE_OPLINE
    3963             : 
    3964             :         SAVE_OPLINE();
    3965             :         if (IS_CONST != IS_UNUSED) {
    3966             : 
    3967         853 :                 zval *ptr = EX_CONSTANT(opline->op1);
    3968             : 
    3969             :                 do {
    3970         853 :                         if (Z_TYPE_P(ptr) == IS_LONG) {
    3971          34 :                                 EG(exit_status) = Z_LVAL_P(ptr);
    3972             :                         } else {
    3973         819 :                                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) {
    3974             :                                         ptr = Z_REFVAL_P(ptr);
    3975             :                                         if (Z_TYPE_P(ptr) == IS_LONG) {
    3976             :                                                 EG(exit_status) = Z_LVAL_P(ptr);
    3977             :                                                 break;
    3978             :                                         }
    3979             :                                 }
    3980         819 :                                 zend_print_variable(ptr);
    3981             :                         }
    3982             :                 } while (0);
    3983             : 
    3984             :         }
    3985         853 :         zend_bailout();
    3986           0 :         ZEND_VM_NEXT_OPCODE(); /* Never reached */
    3987             : }
    3988             : 
    3989           5 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    3990             : {
    3991           5 :         USE_OPLINE
    3992             : 
    3993             :         zval *value;
    3994           5 :         zval *ref = NULL;
    3995             : 
    3996             :         SAVE_OPLINE();
    3997           5 :         value = EX_CONSTANT(opline->op1);
    3998             : 
    3999           5 :         if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
    4000             :                 if (IS_CONST == IS_VAR) {
    4001             :                         ref = value;
    4002             :                 }
    4003             :                 value = Z_REFVAL_P(value);
    4004             :         }
    4005           5 :         if (i_zend_is_true(value)) {
    4006           3 :                 ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
    4007             :                 if (IS_CONST == IS_CONST) {
    4008           3 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
    4009           0 :                                 zval_copy_ctor_func(EX_VAR(opline->result.var));
    4010             :                         }
    4011             :                 } else if (IS_CONST == IS_CV) {
    4012             :                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    4013             :                 } else if (IS_CONST == IS_VAR && ref) {
    4014             :                         zend_reference *r = Z_REF_P(ref);
    4015             : 
    4016             :                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    4017             :                         if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
    4018             :                                 efree_size(r, sizeof(zend_reference));
    4019             :                         }
    4020             :                 }
    4021           3 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    4022             :         }
    4023             : 
    4024           2 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4025             : }
    4026             : 
    4027           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4028             : {
    4029           0 :         USE_OPLINE
    4030             : 
    4031             :         zval *value;
    4032           0 :         zval *ref = NULL;
    4033             : 
    4034             :         SAVE_OPLINE();
    4035           0 :         value = EX_CONSTANT(opline->op1);
    4036             : 
    4037           0 :         if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
    4038             :                 if (IS_CONST == IS_VAR) {
    4039             :                         ref = value;
    4040             :                 }
    4041             :                 value = Z_REFVAL_P(value);
    4042             :         }
    4043             : 
    4044           0 :         if (Z_TYPE_P(value) > IS_NULL) {
    4045           0 :                 ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
    4046             :                 if (IS_CONST == IS_CONST) {
    4047           0 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
    4048           0 :                                 zval_copy_ctor_func(EX_VAR(opline->result.var));
    4049             :                         }
    4050             :                 } else if (IS_CONST == IS_CV) {
    4051             :                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    4052             :                 } else if (IS_CONST == IS_VAR && ref) {
    4053             :                         zend_reference *r = Z_REF_P(ref);
    4054             : 
    4055             :                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    4056             :                         if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
    4057             :                                 efree_size(r, sizeof(zend_reference));
    4058             :                         }
    4059             :                 }
    4060           0 :                 ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
    4061             :         }
    4062             : 
    4063           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4064             : }
    4065             : 
    4066      497764 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4067             : {
    4068      497764 :         USE_OPLINE
    4069             : 
    4070             :         zval *value;
    4071             : 
    4072      497764 :         value = EX_CONSTANT(opline->op1);
    4073      497764 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
    4074             :                 SAVE_OPLINE();
    4075             :                 GET_OP1_UNDEF_CV(value, BP_VAR_R);
    4076             :                 ZVAL_NULL(EX_VAR(opline->result.var));
    4077             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4078             :         }
    4079             : 
    4080      497764 :         if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
    4081             :                 ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
    4082             :                 if (IS_CONST == IS_VAR) {
    4083             :                         if (UNEXPECTED(Z_DELREF_P(value) == 0)) {
    4084             :                                 efree_size(Z_REF_P(value), sizeof(zend_reference));
    4085             :                         }
    4086             :                 }
    4087             :         } else {
    4088      497764 :                 ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
    4089             :                 if (IS_CONST == IS_CONST) {
    4090      497764 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
    4091           6 :                                 zval_copy_ctor_func(EX_VAR(opline->result.var));
    4092             :                         }
    4093             :                 } else if (IS_CONST == IS_CV) {
    4094             :                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    4095             :                 }
    4096             :         }
    4097      497764 :         ZEND_VM_NEXT_OPCODE();
    4098             : }
    4099             : 
    4100           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4101             : {
    4102           2 :         USE_OPLINE
    4103             : 
    4104           2 :         zend_generator *generator = zend_get_running_generator(execute_data);
    4105             : 
    4106             :         zval *val;
    4107             : 
    4108             : 
    4109             :         SAVE_OPLINE();
    4110           2 :         val = EX_CONSTANT(opline->op1);
    4111             : 
    4112           2 :         if (Z_TYPE_P(val) == IS_ARRAY) {
    4113           2 :                 ZVAL_COPY_VALUE(&generator->values, val);
    4114           2 :                 if (IS_CONST != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
    4115             :                         Z_ADDREF_P(val);
    4116             :                 }
    4117           2 :                 Z_FE_POS(generator->values) = 0;
    4118             : 
    4119           0 :         } else if (IS_CONST != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) {
    4120             :                 zend_class_entry *ce = Z_OBJCE_P(val);
    4121             :                 if (ce == zend_ce_generator) {
    4122             :                         zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val);
    4123             : 
    4124             :                         if (IS_CONST != IS_TMP_VAR) {
    4125             :                                 Z_ADDREF_P(val);
    4126             :                         }
    4127             : 
    4128             :                         if (Z_ISUNDEF(new_gen->retval)) {
    4129             :                                 if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
    4130             :                                         zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
    4131             :                                         HANDLE_EXCEPTION();
    4132             :                                 } else {
    4133             :                                         zend_generator_yield_from(generator, new_gen);
    4134             :                                 }
    4135             :                         } else if (UNEXPECTED(new_gen->execute_data == NULL)) {
    4136             :                                 zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
    4137             :                                 HANDLE_EXCEPTION();
    4138             :                         } else {
    4139             :                                 if (RETURN_VALUE_USED(opline)) {
    4140             :                                         ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval);
    4141             :                                 }
    4142             :                                 ZEND_VM_NEXT_OPCODE();
    4143             :                         }
    4144             :                 } else {
    4145             :                         zend_object_iterator *iter = ce->get_iterator(ce, val, 0);
    4146             : 
    4147             :                         if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
    4148             :                                 if (!EG(exception)) {
    4149             :                                         zend_throw_error(NULL, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name));
    4150             :                                 }
    4151             :                                 HANDLE_EXCEPTION();
    4152             :                         }
    4153             : 
    4154             :                         iter->index = 0;
    4155             :                         if (iter->funcs->rewind) {
    4156             :                                 iter->funcs->rewind(iter);
    4157             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    4158             :                                         OBJ_RELEASE(&iter->std);
    4159             :                                         HANDLE_EXCEPTION();
    4160             :                                 }
    4161             :                         }
    4162             : 
    4163             :                         ZVAL_OBJ(&generator->values, &iter->std);
    4164             :                 }
    4165             :         } else {
    4166           0 :                 zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
    4167           0 :                 HANDLE_EXCEPTION();
    4168             :         }
    4169             : 
    4170             :         /* This is the default return value
    4171             :          * when the expression is a Generator, it will be overwritten in zend_generator_resume() */
    4172           2 :         if (RETURN_VALUE_USED(opline)) {
    4173           2 :                 ZVAL_NULL(EX_VAR(opline->result.var));
    4174             :         }
    4175             : 
    4176             :         /* We increment to the next op, so we are at the correct position when the
    4177             :          * generator is resumed. */
    4178           2 :         ZEND_VM_INC_OPCODE();
    4179             : 
    4180             :         /* The GOTO VM uses a local opline variable. We need to set the opline
    4181             :          * variable in execute_data so we don't resume at an old position. */
    4182             :         SAVE_OPLINE();
    4183             : 
    4184           2 :         ZEND_VM_RETURN();
    4185             : }
    4186             : 
    4187           4 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4188             : {
    4189           4 :         USE_OPLINE
    4190             :         zval *value;
    4191             : 
    4192             : 
    4193             :         SAVE_OPLINE();
    4194           4 :         value = EX_CONSTANT(opline->op1);
    4195             : try_strlen:
    4196           4 :         if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) {
    4197           0 :                 ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value));
    4198             :         } else {
    4199             :                 zend_bool strict;
    4200             : 
    4201           4 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
    4202             :                         value = GET_OP1_UNDEF_CV(value, BP_VAR_R);
    4203             :                 }
    4204           4 :                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(value) == IS_REFERENCE) {
    4205             :                         value = Z_REFVAL_P(value);
    4206             :                         goto try_strlen;
    4207             :                 }
    4208           4 :                 strict = EX_USES_STRICT_TYPES();
    4209             :                 do {
    4210           4 :                         if (EXPECTED(!strict)) {
    4211             :                                 zend_string *str;
    4212             :                                 zval tmp;
    4213             : 
    4214           3 :                                 ZVAL_COPY(&tmp, value);
    4215           3 :                                 if (zend_parse_arg_str_weak(&tmp, &str)) {
    4216           3 :                                         ZVAL_LONG(EX_VAR(opline->result.var), ZSTR_LEN(str));
    4217             :                                         zval_ptr_dtor(&tmp);
    4218           3 :                                         break;
    4219             :                                 }
    4220             :                                 zval_ptr_dtor(&tmp);
    4221             :                         }
    4222           1 :                         zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
    4223           1 :                         ZVAL_NULL(EX_VAR(opline->result.var));
    4224             :                 } while (0);
    4225             :         }
    4226             : 
    4227           4 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4228             : }
    4229             : 
    4230           5 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4231             : {
    4232           5 :         USE_OPLINE
    4233             :         zval *value;
    4234           5 :         int result = 0;
    4235             : 
    4236             : 
    4237             :         SAVE_OPLINE();
    4238           5 :         value = EX_CONSTANT(opline->op1);
    4239           5 :         if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
    4240           5 :                 if (IS_CONST != IS_CONST && UNEXPECTED(Z_TYPE_P(value) == IS_OBJECT)) {
    4241             :                         zend_class_entry *ce = Z_OBJCE_P(value);
    4242             : 
    4243             :                         if (UNEXPECTED(ZSTR_LEN(ce->name) != sizeof("__PHP_Incomplete_Class") - 1) ||
    4244             :                             EXPECTED(memcmp(ZSTR_VAL(ce->name), "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1) != 0)) {
    4245             :                                 result = 1;
    4246             :                         }
    4247           5 :                 } else if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
    4248           0 :                         const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
    4249             : 
    4250           0 :                         if (EXPECTED(type_name != NULL)) {
    4251           0 :                                 result = 1;
    4252             :                         }
    4253             :                 } else {
    4254           5 :                         result = 1;
    4255             :                 }
    4256           0 :         } else if (UNEXPECTED(opline->extended_value == _IS_BOOL) &&
    4257             :                            EXPECTED(Z_TYPE_P(value) == IS_TRUE || Z_TYPE_P(value) == IS_FALSE)) {
    4258           0 :                 result = 1;
    4259             :         }
    4260             : 
    4261           5 :         ZEND_VM_SMART_BRANCH(result, 1);
    4262           1 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4263           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4264             : }
    4265             : 
    4266         169 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DEFINED_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4267             : {
    4268         169 :         USE_OPLINE
    4269             :         zend_constant *c;
    4270             :         int result;
    4271             : 
    4272         169 :         if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
    4273           1 :                 result = 1;
    4274         168 :         } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0)) == NULL) {
    4275          16 :                 result = 0;
    4276          16 :                 ZVAL_FALSE(EX_VAR(opline->result.var));
    4277             :         } else {
    4278         152 :                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), c);
    4279         152 :                 result = 1;
    4280             :         }
    4281         169 :         ZEND_VM_SMART_BRANCH(result, 0);
    4282         135 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4283         135 :         ZEND_VM_NEXT_OPCODE();
    4284             : }
    4285             : 
    4286           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4287             : {
    4288           0 :         USE_OPLINE
    4289             : 
    4290             :         zval *op1, *op2, *result;
    4291             : 
    4292           0 :         op1 = EX_CONSTANT(opline->op1);
    4293           0 :         op2 = EX_CONSTANT(opline->op2);
    4294           0 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    4295           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4296           0 :                         result = EX_VAR(opline->result.var);
    4297             :                         fast_long_add_function(result, op1, op2);
    4298           0 :                         ZEND_VM_NEXT_OPCODE();
    4299           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4300           0 :                         result = EX_VAR(opline->result.var);
    4301           0 :                         ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2));
    4302           0 :                         ZEND_VM_NEXT_OPCODE();
    4303             :                 }
    4304           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    4305           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4306           0 :                         result = EX_VAR(opline->result.var);
    4307           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2));
    4308           0 :                         ZEND_VM_NEXT_OPCODE();
    4309           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4310           0 :                         result = EX_VAR(opline->result.var);
    4311           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2)));
    4312           0 :                         ZEND_VM_NEXT_OPCODE();
    4313             :                 }
    4314             :         }
    4315             : 
    4316             :         SAVE_OPLINE();
    4317           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    4318             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4319             :         }
    4320           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    4321             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4322             :         }
    4323           0 :         add_function(EX_VAR(opline->result.var), op1, op2);
    4324             : 
    4325             : 
    4326           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4327             : }
    4328             : 
    4329           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4330             : {
    4331           0 :         USE_OPLINE
    4332             : 
    4333             :         zval *op1, *op2, *result;
    4334             : 
    4335           0 :         op1 = EX_CONSTANT(opline->op1);
    4336           0 :         op2 = EX_CONSTANT(opline->op2);
    4337           0 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    4338           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4339           0 :                         result = EX_VAR(opline->result.var);
    4340             :                         fast_long_sub_function(result, op1, op2);
    4341           0 :                         ZEND_VM_NEXT_OPCODE();
    4342           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4343           0 :                         result = EX_VAR(opline->result.var);
    4344           0 :                         ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2));
    4345           0 :                         ZEND_VM_NEXT_OPCODE();
    4346             :                 }
    4347           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    4348           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4349           0 :                         result = EX_VAR(opline->result.var);
    4350           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2));
    4351           0 :                         ZEND_VM_NEXT_OPCODE();
    4352           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4353           0 :                         result = EX_VAR(opline->result.var);
    4354           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2)));
    4355           0 :                         ZEND_VM_NEXT_OPCODE();
    4356             :                 }
    4357             :         }
    4358             : 
    4359             :         SAVE_OPLINE();
    4360           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    4361             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4362             :         }
    4363           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    4364             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4365             :         }
    4366           0 :         sub_function(EX_VAR(opline->result.var), op1, op2);
    4367             : 
    4368             : 
    4369           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4370             : }
    4371             : 
    4372           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4373             : {
    4374           0 :         USE_OPLINE
    4375             : 
    4376             :         zval *op1, *op2, *result;
    4377             : 
    4378           0 :         op1 = EX_CONSTANT(opline->op1);
    4379           0 :         op2 = EX_CONSTANT(opline->op2);
    4380           0 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    4381           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4382             :                         zend_long overflow;
    4383             : 
    4384           0 :                         result = EX_VAR(opline->result.var);
    4385           0 :                         ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow);
    4386           0 :                         Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG;
    4387           0 :                         ZEND_VM_NEXT_OPCODE();
    4388           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4389           0 :                         result = EX_VAR(opline->result.var);
    4390           0 :                         ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2));
    4391           0 :                         ZEND_VM_NEXT_OPCODE();
    4392             :                 }
    4393           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    4394           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4395           0 :                         result = EX_VAR(opline->result.var);
    4396           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2));
    4397           0 :                         ZEND_VM_NEXT_OPCODE();
    4398           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4399           0 :                         result = EX_VAR(opline->result.var);
    4400           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2)));
    4401           0 :                         ZEND_VM_NEXT_OPCODE();
    4402             :                 }
    4403             :         }
    4404             : 
    4405             :         SAVE_OPLINE();
    4406           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    4407             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4408             :         }
    4409           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    4410             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4411             :         }
    4412           0 :         mul_function(EX_VAR(opline->result.var), op1, op2);
    4413             : 
    4414             : 
    4415           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4416             : }
    4417             : 
    4418           5 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4419             : {
    4420           5 :         USE_OPLINE
    4421             : 
    4422             :         zval *op1, *op2;
    4423             : 
    4424             :         SAVE_OPLINE();
    4425           5 :         op1 = EX_CONSTANT(opline->op1);
    4426           5 :         op2 = EX_CONSTANT(opline->op2);
    4427           5 :         fast_div_function(EX_VAR(opline->result.var), op1, op2);
    4428             : 
    4429             : 
    4430           5 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4431             : }
    4432             : 
    4433           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4434             : {
    4435           2 :         USE_OPLINE
    4436             : 
    4437             :         zval *op1, *op2, *result;
    4438             : 
    4439           2 :         op1 = EX_CONSTANT(opline->op1);
    4440           2 :         op2 = EX_CONSTANT(opline->op2);
    4441           2 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    4442           2 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4443           1 :                         result = EX_VAR(opline->result.var);
    4444           1 :                         if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
    4445             :                                 SAVE_OPLINE();
    4446           1 :                                 zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
    4447           1 :                                 HANDLE_EXCEPTION();
    4448           0 :                         } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
    4449             :                                 /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
    4450           0 :                                 ZVAL_LONG(result, 0);
    4451             :                         } else {
    4452           0 :                                 ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2));
    4453             :                         }
    4454           0 :                         ZEND_VM_NEXT_OPCODE();
    4455             :                 }
    4456             :         }
    4457             : 
    4458             :         SAVE_OPLINE();
    4459           1 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    4460             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4461             :         }
    4462           1 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    4463             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4464             :         }
    4465           1 :         mod_function(EX_VAR(opline->result.var), op1, op2);
    4466             : 
    4467             : 
    4468           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4469             : }
    4470             : 
    4471           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4472             : {
    4473           0 :         USE_OPLINE
    4474             : 
    4475             :         zval *op1, *op2;
    4476             : 
    4477             :         SAVE_OPLINE();
    4478           0 :         op1 = EX_CONSTANT(opline->op1);
    4479           0 :         op2 = EX_CONSTANT(opline->op2);
    4480           0 :         shift_left_function(EX_VAR(opline->result.var), op1, op2);
    4481             : 
    4482             : 
    4483           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4484             : }
    4485             : 
    4486           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4487             : {
    4488           0 :         USE_OPLINE
    4489             : 
    4490             :         zval *op1, *op2;
    4491             : 
    4492             :         SAVE_OPLINE();
    4493           0 :         op1 = EX_CONSTANT(opline->op1);
    4494           0 :         op2 = EX_CONSTANT(opline->op2);
    4495           0 :         shift_right_function(EX_VAR(opline->result.var), op1, op2);
    4496             : 
    4497             : 
    4498           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4499             : }
    4500             : 
    4501           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4502             : {
    4503           0 :         USE_OPLINE
    4504             : 
    4505             :         zval *op1, *op2;
    4506             : 
    4507             :         SAVE_OPLINE();
    4508           0 :         op1 = EX_CONSTANT(opline->op1);
    4509           0 :         op2 = EX_CONSTANT(opline->op2);
    4510             : 
    4511             :         do {
    4512             :                 if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
    4513             :                     (IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
    4514           0 :                         zend_string *op1_str = Z_STR_P(op1);
    4515           0 :                         zend_string *op2_str = Z_STR_P(op2);
    4516             :                         zend_string *str;
    4517             : 
    4518           0 :                         if (IS_CONST != IS_CONST) {
    4519             :                                 if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) {
    4520             :                                         ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str);
    4521             : 
    4522             :                                         break;
    4523             :                                 }
    4524             :                         }
    4525           0 :                         if (IS_CONST != IS_CONST) {
    4526             :                                 if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) {
    4527             :                                         ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str);
    4528             : 
    4529             :                                         break;
    4530             :                                 }
    4531             :                         }
    4532           0 :                         if (IS_CONST != IS_CONST && IS_CONST != IS_CV &&
    4533             :                             !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
    4534             :                             size_t len = ZSTR_LEN(op1_str);
    4535             : 
    4536             :                                 str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
    4537             :                                 memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
    4538             :                                 ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
    4539             :                                 break;
    4540             :                         } else {
    4541           0 :                                 str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0);
    4542           0 :                                 memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str));
    4543           0 :                                 memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
    4544           0 :                                 ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
    4545             :                         }
    4546             :                 } else {
    4547             :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    4548             :                                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4549             :                         }
    4550             :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    4551             :                                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4552             :                         }
    4553             :                         concat_function(EX_VAR(opline->result.var), op1, op2);
    4554             :                 }
    4555             : 
    4556             :         } while (0);
    4557             : 
    4558           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4559             : }
    4560             : 
    4561           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4562             : {
    4563           0 :         USE_OPLINE
    4564             : 
    4565             :         zval *op1, *op2;
    4566             :         int result;
    4567             : 
    4568             :         SAVE_OPLINE();
    4569           0 :         op1 = EX_CONSTANT(opline->op1);
    4570           0 :         op2 = EX_CONSTANT(opline->op2);
    4571           0 :         result = fast_is_identical_function(op1, op2);
    4572             : 
    4573             : 
    4574           0 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
    4575           0 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4576           0 :         if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
    4577             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4578             :         }
    4579           0 :         ZEND_VM_NEXT_OPCODE();
    4580             : }
    4581             : 
    4582           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4583             : {
    4584           0 :         USE_OPLINE
    4585             : 
    4586             :         zval *op1, *op2;
    4587             :         int result;
    4588             : 
    4589             :         SAVE_OPLINE();
    4590           0 :         op1 = EX_CONSTANT(opline->op1);
    4591           0 :         op2 = EX_CONSTANT(opline->op2);
    4592           0 :         result = fast_is_not_identical_function(op1, op2);
    4593             : 
    4594             : 
    4595           0 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
    4596           0 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4597           0 :         if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
    4598             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4599             :         }
    4600           0 :         ZEND_VM_NEXT_OPCODE();
    4601             : }
    4602             : 
    4603           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4604             : {
    4605           0 :         USE_OPLINE
    4606             : 
    4607             :         zval *op1, *op2, *result;
    4608             : 
    4609           0 :         op1 = EX_CONSTANT(opline->op1);
    4610           0 :         op2 = EX_CONSTANT(opline->op2);
    4611             :         do {
    4612             :                 int result;
    4613             : 
    4614           0 :                 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
    4615           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    4616           0 :                                 result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
    4617           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    4618           0 :                                 result = ((double)Z_LVAL_P(op1) == Z_DVAL_P(op2));
    4619             :                         } else {
    4620           0 :                                 break;
    4621             :                         }
    4622           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
    4623           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    4624           0 :                                 result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
    4625           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    4626           0 :                                 result = (Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2)));
    4627             :                         } else {
    4628           0 :                                 break;
    4629             :                         }
    4630           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    4631           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    4632           0 :                                 if (Z_STR_P(op1) == Z_STR_P(op2)) {
    4633           0 :                                         result = 1;
    4634           0 :                                 } else if (Z_STRVAL_P(op1)[0] > '9' || Z_STRVAL_P(op2)[0] > '9') {
    4635           0 :                                         if (Z_STRLEN_P(op1) != Z_STRLEN_P(op2)) {
    4636           0 :                                                 result = 0;
    4637             :                                         } else {
    4638           0 :                                                 result = (memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) == 0);
    4639             :                                         }
    4640             :                                 } else {
    4641           0 :                                         result = (zendi_smart_strcmp(op1, op2) == 0);
    4642             :                                 }
    4643             : 
    4644             : 
    4645             :                         } else {
    4646           0 :                                 break;
    4647             :                         }
    4648             :                 } else {
    4649           0 :                         break;
    4650             :                 }
    4651           0 :                 ZEND_VM_SMART_BRANCH(result, 0);
    4652           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4653           0 :                 ZEND_VM_NEXT_OPCODE();
    4654             :         } while (0);
    4655             : 
    4656             :         SAVE_OPLINE();
    4657           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    4658             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4659             :         }
    4660           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    4661             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4662             :         }
    4663           0 :         result = EX_VAR(opline->result.var);
    4664           0 :         compare_function(result, op1, op2);
    4665           0 :         ZVAL_BOOL(result, Z_LVAL_P(result) == 0);
    4666             : 
    4667             : 
    4668           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4669             : }
    4670             : 
    4671           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4672             : {
    4673           0 :         USE_OPLINE
    4674             : 
    4675             :         zval *op1, *op2, *result;
    4676             : 
    4677           0 :         op1 = EX_CONSTANT(opline->op1);
    4678           0 :         op2 = EX_CONSTANT(opline->op2);
    4679             :         do {
    4680             :                 int result;
    4681             : 
    4682           0 :                 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
    4683           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    4684           0 :                                 result = (Z_LVAL_P(op1) != Z_LVAL_P(op2));
    4685           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    4686           0 :                                 result = ((double)Z_LVAL_P(op1) != Z_DVAL_P(op2));
    4687             :                         } else {
    4688           0 :                                 break;
    4689             :                         }
    4690           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
    4691           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    4692           0 :                                 result = (Z_DVAL_P(op1) != Z_DVAL_P(op2));
    4693           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    4694           0 :                                 result = (Z_DVAL_P(op1) != ((double)Z_LVAL_P(op2)));
    4695             :                         } else {
    4696           0 :                                 break;
    4697             :                         }
    4698           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    4699           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    4700           0 :                                 if (Z_STR_P(op1) == Z_STR_P(op2)) {
    4701           0 :                                         result = 0;
    4702           0 :                                 } else if (Z_STRVAL_P(op1)[0] > '9' || Z_STRVAL_P(op2)[0] > '9') {
    4703           0 :                                         if (Z_STRLEN_P(op1) != Z_STRLEN_P(op2)) {
    4704           0 :                                                 result = 1;
    4705             :                                         } else {
    4706           0 :                                                 result = (memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) != 0);
    4707             :                                         }
    4708             :                                 } else {
    4709           0 :                                         result = (zendi_smart_strcmp(op1, op2) != 0);
    4710             :                                 }
    4711             : 
    4712             : 
    4713             :                         } else {
    4714           0 :                                 break;
    4715             :                         }
    4716             :                 } else {
    4717           0 :                         break;
    4718             :                 }
    4719           0 :                 ZEND_VM_SMART_BRANCH(result, 0);
    4720           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4721           0 :                 ZEND_VM_NEXT_OPCODE();
    4722             :         } while (0);
    4723             : 
    4724             :         SAVE_OPLINE();
    4725           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    4726             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4727             :         }
    4728           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    4729             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4730             :         }
    4731           0 :         result = EX_VAR(opline->result.var);
    4732           0 :         compare_function(result, op1, op2);
    4733           0 :         ZVAL_BOOL(result, Z_LVAL_P(result) != 0);
    4734             : 
    4735             : 
    4736           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4737             : }
    4738             : 
    4739           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4740             : {
    4741           0 :         USE_OPLINE
    4742             : 
    4743             :         zval *op1, *op2, *result;
    4744             : 
    4745           0 :         op1 = EX_CONSTANT(opline->op1);
    4746           0 :         op2 = EX_CONSTANT(opline->op2);
    4747             :         do {
    4748             :                 int result;
    4749             : 
    4750           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    4751           0 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4752           0 :                                 result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
    4753           0 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4754           0 :                                 result = ((double)Z_LVAL_P(op1) < Z_DVAL_P(op2));
    4755             :                         } else {
    4756           0 :                                 break;
    4757             :                         }
    4758           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    4759           0 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4760           0 :                                 result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
    4761           0 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4762           0 :                                 result = (Z_DVAL_P(op1) < ((double)Z_LVAL_P(op2)));
    4763             :                         } else {
    4764           0 :                                 break;
    4765             :                         }
    4766             :                 } else {
    4767           0 :                         break;
    4768             :                 }
    4769           0 :                 ZEND_VM_SMART_BRANCH(result, 0);
    4770           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4771           0 :                 ZEND_VM_NEXT_OPCODE();
    4772             :         } while (0);
    4773             : 
    4774             :         SAVE_OPLINE();
    4775           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    4776             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4777             :         }
    4778           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    4779             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4780             :         }
    4781           0 :         result = EX_VAR(opline->result.var);
    4782           0 :         compare_function(result, op1, op2);
    4783           0 :         ZVAL_BOOL(result, Z_LVAL_P(result) < 0);
    4784             : 
    4785             : 
    4786           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4787             : }
    4788             : 
    4789           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4790             : {
    4791           0 :         USE_OPLINE
    4792             : 
    4793             :         zval *op1, *op2, *result;
    4794             : 
    4795           0 :         op1 = EX_CONSTANT(opline->op1);
    4796           0 :         op2 = EX_CONSTANT(opline->op2);
    4797             :         do {
    4798             :                 int result;
    4799             : 
    4800           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    4801           0 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4802           0 :                                 result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
    4803           0 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4804           0 :                                 result = ((double)Z_LVAL_P(op1) <= Z_DVAL_P(op2));
    4805             :                         } else {
    4806           0 :                                 break;
    4807             :                         }
    4808           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    4809           0 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    4810           0 :                                 result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
    4811           0 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    4812           0 :                                 result = (Z_DVAL_P(op1) <= ((double)Z_LVAL_P(op2)));
    4813             :                         } else {
    4814           0 :                                 break;
    4815             :                         }
    4816             :                 } else {
    4817           0 :                         break;
    4818             :                 }
    4819           0 :                 ZEND_VM_SMART_BRANCH(result, 0);
    4820           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    4821           0 :                 ZEND_VM_NEXT_OPCODE();
    4822             :         } while (0);
    4823             : 
    4824             :         SAVE_OPLINE();
    4825           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    4826             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    4827             :         }
    4828           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    4829             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    4830             :         }
    4831           0 :         result = EX_VAR(opline->result.var);
    4832           0 :         compare_function(result, op1, op2);
    4833           0 :         ZVAL_BOOL(result, Z_LVAL_P(result) <= 0);
    4834             : 
    4835             : 
    4836           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4837             : }
    4838             : 
    4839           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4840             : {
    4841           0 :         USE_OPLINE
    4842             : 
    4843             :         zval *op1, *op2;
    4844             : 
    4845             :         SAVE_OPLINE();
    4846           0 :         op1 = EX_CONSTANT(opline->op1);
    4847           0 :         op2 = EX_CONSTANT(opline->op2);
    4848           0 :         compare_function(EX_VAR(opline->result.var), op1, op2);
    4849             : 
    4850             : 
    4851           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4852             : }
    4853             : 
    4854           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4855             : {
    4856           0 :         USE_OPLINE
    4857             : 
    4858             :         zval *op1, *op2;
    4859             : 
    4860             :         SAVE_OPLINE();
    4861           0 :         op1 = EX_CONSTANT(opline->op1);
    4862           0 :         op2 = EX_CONSTANT(opline->op2);
    4863           0 :         bitwise_or_function(EX_VAR(opline->result.var), op1, op2);
    4864             : 
    4865             : 
    4866           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4867             : }
    4868             : 
    4869           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4870             : {
    4871           0 :         USE_OPLINE
    4872             : 
    4873             :         zval *op1, *op2;
    4874             : 
    4875             :         SAVE_OPLINE();
    4876           0 :         op1 = EX_CONSTANT(opline->op1);
    4877           0 :         op2 = EX_CONSTANT(opline->op2);
    4878           0 :         bitwise_and_function(EX_VAR(opline->result.var), op1, op2);
    4879             : 
    4880             : 
    4881           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4882             : }
    4883             : 
    4884           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4885             : {
    4886           0 :         USE_OPLINE
    4887             : 
    4888             :         zval *op1, *op2;
    4889             : 
    4890             :         SAVE_OPLINE();
    4891           0 :         op1 = EX_CONSTANT(opline->op1);
    4892           0 :         op2 = EX_CONSTANT(opline->op2);
    4893           0 :         bitwise_xor_function(EX_VAR(opline->result.var), op1, op2);
    4894             : 
    4895             : 
    4896           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4897             : }
    4898             : 
    4899           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    4900             : {
    4901           0 :         USE_OPLINE
    4902             : 
    4903             :         zval *op1, *op2;
    4904             : 
    4905             :         SAVE_OPLINE();
    4906           0 :         op1 = EX_CONSTANT(opline->op1);
    4907           0 :         op2 = EX_CONSTANT(opline->op2);
    4908           0 :         boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
    4909             : 
    4910             : 
    4911           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4912             : }
    4913             : 
    4914         350 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type ZEND_OPCODE_HANDLER_ARGS_DC)
    4915             : {
    4916         350 :         USE_OPLINE
    4917             : 
    4918             :         zval *varname;
    4919             :         zval *retval;
    4920             :         zend_string *name;
    4921             :         HashTable *target_symbol_table;
    4922             : 
    4923             :         SAVE_OPLINE();
    4924         350 :         varname = EX_CONSTANT(opline->op1);
    4925             : 
    4926             :         if (IS_CONST == IS_CONST) {
    4927         350 :                 name = Z_STR_P(varname);
    4928             :         } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) {
    4929             :                 name = Z_STR_P(varname);
    4930             :                 zend_string_addref(name);
    4931             :         } else {
    4932             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) {
    4933             :                         GET_OP1_UNDEF_CV(varname, BP_VAR_R);
    4934             :                 }
    4935             :                 name = zval_get_string(varname);
    4936             :         }
    4937             : 
    4938             :         if (IS_CONST != IS_UNUSED) {
    4939             :                 zend_class_entry *ce;
    4940             : 
    4941             :                 if (IS_CONST == IS_CONST) {
    4942         350 :                         if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
    4943          75 :                                 retval = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
    4944             : 
    4945             :                                 /* check if static properties were destoyed */
    4946          75 :                                 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    4947           0 :                                         zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
    4948             : 
    4949           0 :                                         HANDLE_EXCEPTION();
    4950             :                                 }
    4951             : 
    4952          75 :                                 goto fetch_var_return;
    4953         275 :                         } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
    4954         275 :                                 ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    4955         275 :                                 if (UNEXPECTED(ce == NULL)) {
    4956           1 :                                         if (IS_CONST != IS_CONST) {
    4957             :                                                 zend_string_release(name);
    4958             :                                         }
    4959             : 
    4960           1 :                                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    4961             :                                 }
    4962         274 :                                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    4963             :                         }
    4964             :                 } else {
    4965             :                         ce = Z_CE_P(EX_VAR(opline->op2.var));
    4966             :                         if (IS_CONST == IS_CONST &&
    4967             :                             (retval = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce)) != NULL) {
    4968             : 
    4969             :                                 /* check if static properties were destoyed */
    4970             :                                 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    4971             :                                         zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
    4972             : 
    4973             :                                         HANDLE_EXCEPTION();
    4974             :                                 }
    4975             : 
    4976             :                                 goto fetch_var_return;
    4977             :                         }
    4978             :                 }
    4979         274 :                 retval = zend_std_get_static_property(ce, name, 0);
    4980         274 :                 if (UNEXPECTED(EG(exception))) {
    4981             : 
    4982          11 :                         HANDLE_EXCEPTION();
    4983             :                 }
    4984         263 :                 if (IS_CONST == IS_CONST && retval) {
    4985         263 :                         CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
    4986             :                 }
    4987             : 
    4988             :         } else {
    4989             :                 target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    4990             :                 retval = zend_hash_find(target_symbol_table, name);
    4991             :                 if (retval == NULL) {
    4992             :                         switch (type) {
    4993             :                                 case BP_VAR_R:
    4994             :                                 case BP_VAR_UNSET:
    4995             :                                         zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    4996             :                                         /* break missing intentionally */
    4997             :                                 case BP_VAR_IS:
    4998             :                                         retval = &EG(uninitialized_zval);
    4999             :                                         break;
    5000             :                                 case BP_VAR_RW:
    5001             :                                         zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    5002             :                                         /* break missing intentionally */
    5003             :                                 case BP_VAR_W:
    5004             :                                         retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
    5005             :                                         break;
    5006             :                                 EMPTY_SWITCH_DEFAULT_CASE()
    5007             :                         }
    5008             :                 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
    5009             :                 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
    5010             :                         retval = Z_INDIRECT_P(retval);
    5011             :                         if (Z_TYPE_P(retval) == IS_UNDEF) {
    5012             :                                 switch (type) {
    5013             :                                         case BP_VAR_R:
    5014             :                                         case BP_VAR_UNSET:
    5015             :                                                 zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    5016             :                                                 /* break missing intentionally */
    5017             :                                         case BP_VAR_IS:
    5018             :                                                 retval = &EG(uninitialized_zval);
    5019             :                                                 break;
    5020             :                                         case BP_VAR_RW:
    5021             :                                                 zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    5022             :                                                 /* break missing intentionally */
    5023             :                                         case BP_VAR_W:
    5024             :                                                 ZVAL_NULL(retval);
    5025             :                                                 break;
    5026             :                                         EMPTY_SWITCH_DEFAULT_CASE()
    5027             :                                 }
    5028             :                         }
    5029             :                 }
    5030             :                 if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
    5031             :                         if (Z_CONSTANT_P(retval)) {
    5032             :                                 if (UNEXPECTED(zval_update_constant_ex(retval, 1, NULL) != SUCCESS)) {
    5033             : 
    5034             :                                         HANDLE_EXCEPTION();
    5035             :                                 }
    5036             :                         }
    5037             :                 } else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
    5038             : 
    5039             :                 }
    5040             :         }
    5041             : 
    5042         263 :         if (IS_CONST != IS_CONST) {
    5043             :                 zend_string_release(name);
    5044             :         }
    5045             : 
    5046             : fetch_var_return:
    5047             :         ZEND_ASSERT(retval != NULL);
    5048         600 :         if (type == BP_VAR_R || type == BP_VAR_IS) {
    5049         296 :                 if (/*type == BP_VAR_R &&*/ Z_ISREF_P(retval) && Z_REFCOUNT_P(retval) == 1) {
    5050           1 :                         ZVAL_UNREF(retval);
    5051             :                 }
    5052         262 :                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5053             :         } else {
    5054          76 :                 ZVAL_INDIRECT(EX_VAR(opline->result.var), retval);
    5055             :         }
    5056         338 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5057             : }
    5058             : 
    5059         234 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5060             : {
    5061         234 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5062             : }
    5063             : 
    5064          64 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5065             : {
    5066          64 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5067             : }
    5068             : 
    5069          14 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5070             : {
    5071          14 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5072             : }
    5073             : 
    5074          36 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5075             : {
    5076          36 :         USE_OPLINE
    5077             : 
    5078          72 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    5079           0 :                 ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5080             :         } else {
    5081          36 :                 ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5082             :         }
    5083             : }
    5084             : 
    5085           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5086             : {
    5087           2 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5088             : }
    5089             : 
    5090           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5091             : {
    5092           0 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    5093             : }
    5094             : 
    5095          16 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5096             : {
    5097          16 :         USE_OPLINE
    5098             : 
    5099             :         zval *container;
    5100             : 
    5101             :         SAVE_OPLINE();
    5102          16 :         container = EX_CONSTANT(opline->op1);
    5103          16 :         zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
    5104             : 
    5105             : 
    5106          16 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5107             : }
    5108             : 
    5109           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5110             : {
    5111           2 :         USE_OPLINE
    5112             : 
    5113             :         zval *container;
    5114             : 
    5115             :         SAVE_OPLINE();
    5116           2 :         container = EX_CONSTANT(opline->op1);
    5117           2 :         zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
    5118             : 
    5119             : 
    5120           2 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5121             : }
    5122             : 
    5123           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5124             : {
    5125           1 :         USE_OPLINE
    5126             :         zval *container;
    5127             :         zend_free_op free_op1;
    5128             : 
    5129             :         SAVE_OPLINE();
    5130             : 
    5131           2 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    5132             :         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    5133           1 :             zend_throw_error(NULL, "Cannot use temporary expression in write context");
    5134             : 
    5135             : 
    5136           1 :                         HANDLE_EXCEPTION();
    5137             :         }
    5138             :                 container = NULL;
    5139             :                 if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
    5140             :                         zend_throw_error(NULL, "Cannot use string offset as an array");
    5141             : 
    5142             :                         HANDLE_EXCEPTION();
    5143             :                 }
    5144             :                 zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
    5145             :                 if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
    5146             :                         EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var), 1);
    5147             :                 }
    5148             : 
    5149             : 
    5150             :         } else {
    5151           0 :                 if (IS_CONST == IS_UNUSED) {
    5152             :                         zend_throw_error(NULL, "Cannot use [] for reading");
    5153             : 
    5154             : 
    5155             :                         HANDLE_EXCEPTION();
    5156             :                 }
    5157           0 :                 container = EX_CONSTANT(opline->op1);
    5158           0 :                 zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST);
    5159             : 
    5160             : 
    5161             :         }
    5162           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5163             : }
    5164             : 
    5165           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5166             : {
    5167           1 :         USE_OPLINE
    5168             : 
    5169             :         zval *container;
    5170             : 
    5171             :         zval *offset;
    5172             : 
    5173             :         SAVE_OPLINE();
    5174           1 :         container = EX_CONSTANT(opline->op1);
    5175             : 
    5176           1 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    5177             :                 zend_throw_error(NULL, "Using $this when not in object context");
    5178             : 
    5179             :                 HANDLE_EXCEPTION();
    5180             :         }
    5181             : 
    5182           1 :         offset = EX_CONSTANT(opline->op2);
    5183             : 
    5184             :         if (IS_CONST == IS_CONST ||
    5185             :             (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
    5186           1 :                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
    5187             :                         container = Z_REFVAL_P(container);
    5188             :                         if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
    5189             :                                 goto fetch_obj_r_no_object;
    5190             :                         }
    5191             :                 } else {
    5192           1 :                         goto fetch_obj_r_no_object;
    5193             :                 }
    5194             :         }
    5195             : 
    5196             :         /* here we are sure we are dealing with an object */
    5197             :         do {
    5198             :                 zend_object *zobj = Z_OBJ_P(container);
    5199             :                 zval *retval;
    5200             : 
    5201             :                 if (IS_CONST == IS_CONST &&
    5202             :                         EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
    5203             :                         uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
    5204             : 
    5205             :                         if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
    5206             :                                 retval = OBJ_PROP(zobj, prop_offset);
    5207             :                                 if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
    5208             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5209             :                                         break;
    5210             :                                 }
    5211             :                         } else if (EXPECTED(zobj->properties != NULL)) {
    5212             :                                 retval = zend_hash_find(zobj->properties, Z_STR_P(offset));
    5213             :                                 if (EXPECTED(retval)) {
    5214             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5215             :                                         break;
    5216             :                                 }
    5217             :                         }
    5218             :                 }
    5219             : 
    5220             :                 if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
    5221             : fetch_obj_r_no_object:
    5222           1 :                         zend_error(E_NOTICE, "Trying to get property of non-object");
    5223           1 :                         ZVAL_NULL(EX_VAR(opline->result.var));
    5224             :                 } else {
    5225             :                         retval = zobj->handlers->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
    5226             : 
    5227             :                         if (retval != EX_VAR(opline->result.var)) {
    5228             :                                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5229             :                         }
    5230             :                 }
    5231             :         } while (0);
    5232             : 
    5233             : 
    5234           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5235             : }
    5236             : 
    5237           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5238             : {
    5239           1 :         USE_OPLINE
    5240             : 
    5241             :         zval *container;
    5242             : 
    5243             :         zval *offset;
    5244             : 
    5245             :         SAVE_OPLINE();
    5246           1 :         container = EX_CONSTANT(opline->op1);
    5247             : 
    5248           1 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    5249             :                 zend_throw_error(NULL, "Using $this when not in object context");
    5250             : 
    5251             :                 HANDLE_EXCEPTION();
    5252             :         }
    5253             : 
    5254           1 :         offset  = EX_CONSTANT(opline->op2);
    5255             : 
    5256             :         if (IS_CONST == IS_CONST ||
    5257             :             (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
    5258           1 :                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
    5259             :                         container = Z_REFVAL_P(container);
    5260             :                         if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
    5261             :                                 goto fetch_obj_is_no_object;
    5262             :                         }
    5263             :                 } else {
    5264           1 :                         goto fetch_obj_is_no_object;
    5265             :                 }
    5266             :         }
    5267             : 
    5268             :         /* here we are sure we are dealing with an object */
    5269             :         do {
    5270             :                 zend_object *zobj = Z_OBJ_P(container);
    5271             :                 zval *retval;
    5272             : 
    5273             :                 if (IS_CONST == IS_CONST &&
    5274             :                         EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
    5275             :                         uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
    5276             : 
    5277             :                         if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
    5278             :                                 retval = OBJ_PROP(zobj, prop_offset);
    5279             :                                 if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
    5280             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5281             :                                         break;
    5282             :                                 }
    5283             :                         } else if (EXPECTED(zobj->properties != NULL)) {
    5284             :                                 retval = zend_hash_find(zobj->properties, Z_STR_P(offset));
    5285             :                                 if (EXPECTED(retval)) {
    5286             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5287             :                                         break;
    5288             :                                 }
    5289             :                         }
    5290             :                 }
    5291             : 
    5292             :                 if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
    5293             : fetch_obj_is_no_object:
    5294           1 :                         ZVAL_NULL(EX_VAR(opline->result.var));
    5295             :                 } else {
    5296             : 
    5297             :                         retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
    5298             : 
    5299             :                         if (retval != EX_VAR(opline->result.var)) {
    5300             :                                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    5301             :                         }
    5302             :                 }
    5303             :         } while (0);
    5304             : 
    5305             : 
    5306           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5307             : }
    5308             : 
    5309           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5310             : {
    5311           1 :         USE_OPLINE
    5312             :         zval *container;
    5313             : 
    5314           2 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    5315             :                 /* Behave like FETCH_OBJ_W */
    5316             :                 zend_free_op free_op1;
    5317             :                 zval *property;
    5318             : 
    5319             :                 SAVE_OPLINE();
    5320           1 :                 property = EX_CONSTANT(opline->op2);
    5321           1 :                 container = NULL;
    5322             : 
    5323           1 :                 if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    5324             :                         zend_throw_error(NULL, "Using $this when not in object context");
    5325             : 
    5326             :                         HANDLE_EXCEPTION();
    5327             :                 }
    5328             :                 if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    5329           1 :                         zend_throw_error(NULL, "Cannot use temporary expression in write context");
    5330             : 
    5331             : 
    5332           1 :                         HANDLE_EXCEPTION();
    5333             :                 }
    5334             :                 if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
    5335             :                         zend_throw_error(NULL, "Cannot use string offset as an object");
    5336             : 
    5337             :                         HANDLE_EXCEPTION();
    5338             :                 }
    5339             :                 zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
    5340             : 
    5341             :                 if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
    5342             :                         EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var), 0);
    5343             :                 }
    5344             : 
    5345             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5346             :         } else {
    5347           0 :                 ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    5348             :         }
    5349             : }
    5350             : 
    5351          28 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5352             : {
    5353          28 :         USE_OPLINE
    5354             : 
    5355             :         zval *container;
    5356             : 
    5357             :         SAVE_OPLINE();
    5358          28 :         container = EX_CONSTANT(opline->op1);
    5359             : 
    5360             : try_fetch_list:
    5361          28 :         if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
    5362          21 :                 zval *value = zend_hash_index_find(Z_ARRVAL_P(container), Z_LVAL_P(EX_CONSTANT(opline->op2)));
    5363             : 
    5364          21 :                 if (UNEXPECTED(value == NULL)) {
    5365           5 :                         zend_error(E_NOTICE,"Undefined offset: " ZEND_ULONG_FMT, Z_LVAL_P(EX_CONSTANT(opline->op2)));
    5366           5 :                         ZVAL_NULL(EX_VAR(opline->result.var));
    5367             :                 } else {
    5368          16 :                         ZVAL_COPY(EX_VAR(opline->result.var), value);
    5369             :                 }
    5370           7 :         } else if (IS_CONST != IS_CONST &&
    5371             :                    UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT) &&
    5372             :                    EXPECTED(Z_OBJ_HT_P(container)->read_dimension)) {
    5373             :                 zval *result = EX_VAR(opline->result.var);
    5374             :                 zval *retval = Z_OBJ_HT_P(container)->read_dimension(container, EX_CONSTANT(opline->op2), BP_VAR_R, result);
    5375             : 
    5376             :                 if (retval) {
    5377             :                         if (result != retval) {
    5378             :                                 ZVAL_COPY(result, retval);
    5379             :                         }
    5380             :                 } else {
    5381             :                         ZVAL_NULL(result);
    5382             :                 }
    5383           7 :         } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(container) == IS_REFERENCE) {
    5384             :                 container = Z_REFVAL_P(container);
    5385             :                 goto try_fetch_list;
    5386             :         } else {
    5387           7 :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
    5388             :                         GET_OP1_UNDEF_CV(container, BP_VAR_R);
    5389             :                 }
    5390           7 :                 ZVAL_NULL(EX_VAR(opline->result.var));
    5391             :         }
    5392          28 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5393             : }
    5394             : 
    5395           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5396             : {
    5397           0 :         USE_OPLINE
    5398             : 
    5399             :         zval *op1, *op2;
    5400             :         zend_string *op1_str, *op2_str, *str;
    5401             : 
    5402             :         SAVE_OPLINE();
    5403           0 :         op1 = EX_CONSTANT(opline->op1);
    5404             :         if (IS_CONST == IS_CONST) {
    5405           0 :                 op1_str = Z_STR_P(op1);
    5406             :         } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    5407             :                 op1_str = zend_string_copy(Z_STR_P(op1));
    5408             :         } else {
    5409             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    5410             :                         GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    5411             :                 }
    5412             :                 op1_str = _zval_get_string_func(op1);
    5413             :         }
    5414           0 :         op2 = EX_CONSTANT(opline->op2);
    5415             :         if (IS_CONST == IS_CONST) {
    5416           0 :                 op2_str = Z_STR_P(op2);
    5417             :         } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    5418             :                 op2_str = zend_string_copy(Z_STR_P(op2));
    5419             :         } else {
    5420             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    5421             :                         GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    5422             :                 }
    5423             :                 op2_str = _zval_get_string_func(op2);
    5424             :         }
    5425             :         do {
    5426           0 :                 if (IS_CONST != IS_CONST) {
    5427             :                         if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) {
    5428             :                                 if (IS_CONST == IS_CONST) {
    5429             :                                         zend_string_addref(op2_str);
    5430             :                                 }
    5431             :                                 ZVAL_STR(EX_VAR(opline->result.var), op2_str);
    5432             :                                 zend_string_release(op1_str);
    5433             :                                 break;
    5434             :                         }
    5435             :                 }
    5436           0 :                 if (IS_CONST != IS_CONST) {
    5437             :                         if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) {
    5438             :                                 if (IS_CONST == IS_CONST) {
    5439             :                                         zend_string_addref(op1_str);
    5440             :                                 }
    5441             :                                 ZVAL_STR(EX_VAR(opline->result.var), op1_str);
    5442             :                                 zend_string_release(op2_str);
    5443             :                                 break;
    5444             :                         }
    5445             :                 }
    5446           0 :                 str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0);
    5447           0 :                 memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str));
    5448           0 :                 memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
    5449           0 :                 ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
    5450           0 :                 if (IS_CONST != IS_CONST) {
    5451             :                         zend_string_release(op1_str);
    5452             :                 }
    5453           0 :                 if (IS_CONST != IS_CONST) {
    5454             :                         zend_string_release(op2_str);
    5455             :                 }
    5456             :         } while (0);
    5457             : 
    5458             : 
    5459           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5460             : }
    5461             : 
    5462           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5463             : {
    5464           1 :         USE_OPLINE
    5465             :         zval *function_name;
    5466             : 
    5467             :         zval *object;
    5468             :         zend_function *fbc;
    5469             :         zend_class_entry *called_scope;
    5470             :         zend_object *obj;
    5471             :         zend_execute_data *call;
    5472             :         uint32_t call_info;
    5473             : 
    5474             :         SAVE_OPLINE();
    5475             : 
    5476           1 :         function_name = EX_CONSTANT(opline->op2);
    5477             : 
    5478           1 :         if (IS_CONST != IS_CONST &&
    5479             :             UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
    5480             :                 do {
    5481             :                         if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) {
    5482             :                                 function_name = Z_REFVAL_P(function_name);
    5483             :                                 if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
    5484             :                                         break;
    5485             :                                 }
    5486             :                         }
    5487             :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    5488             :                                 GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    5489             :                         }
    5490             :                         if (UNEXPECTED(EG(exception) != NULL)) {
    5491             :                                 HANDLE_EXCEPTION();
    5492             :                         }
    5493             :                         zend_throw_error(NULL, "Method name must be a string");
    5494             : 
    5495             : 
    5496             :                         HANDLE_EXCEPTION();
    5497             :                 } while (0);
    5498             :         }
    5499             : 
    5500           1 :         object = EX_CONSTANT(opline->op1);
    5501             : 
    5502           1 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
    5503             :                 zend_throw_error(NULL, "Using $this when not in object context");
    5504             : 
    5505             :                 HANDLE_EXCEPTION();
    5506             :         }
    5507             : 
    5508             :         if (IS_CONST != IS_UNUSED) {
    5509             :                 do {
    5510             :                         if (IS_CONST == IS_CONST || UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
    5511           1 :                                 if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) {
    5512             :                                         object = Z_REFVAL_P(object);
    5513             :                                         if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) {
    5514             :                                                 break;
    5515             :                                         }
    5516             :                                 }
    5517           1 :                                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
    5518             :                                         GET_OP1_UNDEF_CV(object, BP_VAR_R);
    5519             :                                 }
    5520           1 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    5521           0 :                                         HANDLE_EXCEPTION();
    5522             :                                 }
    5523           1 :                                 zend_throw_error(NULL, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
    5524             : 
    5525             : 
    5526           1 :                                 HANDLE_EXCEPTION();
    5527             :                         }
    5528             :                 } while (0);
    5529             :         }
    5530             : 
    5531             :         obj = Z_OBJ_P(object);
    5532             :         called_scope = obj->ce;
    5533             : 
    5534             :         if (IS_CONST != IS_CONST ||
    5535             :             UNEXPECTED((fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL)) {
    5536             :             zend_object *orig_obj = obj;
    5537             : 
    5538             :                 if (UNEXPECTED(obj->handlers->get_method == NULL)) {
    5539             :                         zend_throw_error(NULL, "Object does not support method calls");
    5540             : 
    5541             : 
    5542             :                         HANDLE_EXCEPTION();
    5543             :                 }
    5544             : 
    5545             :                 /* First, locate the function. */
    5546             :                 fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
    5547             :                 if (UNEXPECTED(fbc == NULL)) {
    5548             :                         if (EXPECTED(!EG(exception))) {
    5549             :                                 zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
    5550             :                         }
    5551             : 
    5552             : 
    5553             :                         HANDLE_EXCEPTION();
    5554             :                 }
    5555             :                 if (IS_CONST == IS_CONST &&
    5556             :                     EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
    5557             :                     EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) &&
    5558             :                     EXPECTED(obj == orig_obj)) {
    5559             :                         CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
    5560             :                 }
    5561             :         }
    5562             : 
    5563             :         call_info = ZEND_CALL_NESTED_FUNCTION;
    5564             :         if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) {
    5565             :                 obj = NULL;
    5566             :         } else if (IS_CONST & (IS_VAR|IS_TMP_VAR|IS_CV)) {
    5567             :                 /* CV may be changed indirectly (e.g. when it's a reference) */
    5568             :                 call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_RELEASE_THIS;
    5569             :                 GC_REFCOUNT(obj)++; /* For $this pointer */
    5570             :         }
    5571             : 
    5572             :         call = zend_vm_stack_push_call_frame(call_info,
    5573             :                 fbc, opline->extended_value, called_scope, obj);
    5574             :         call->prev_execute_data = EX(call);
    5575             :         EX(call) = call;
    5576             : 
    5577             : 
    5578             :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5579             : }
    5580             : 
    5581        5508 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5582             : {
    5583        5508 :         USE_OPLINE
    5584             :         zval *function_name;
    5585             :         zend_class_entry *ce;
    5586             :         zend_object *object;
    5587             :         zend_function *fbc;
    5588             :         zend_execute_data *call;
    5589             : 
    5590             :         SAVE_OPLINE();
    5591             : 
    5592             :         if (IS_CONST == IS_CONST) {
    5593             :                 /* no function found. try a static method in class */
    5594        5508 :                 ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    5595        5508 :                 if (UNEXPECTED(ce == NULL)) {
    5596        2792 :                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT |  ZEND_FETCH_CLASS_EXCEPTION);
    5597        2792 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    5598           2 :                                 HANDLE_EXCEPTION();
    5599             :                         }
    5600        2790 :                         if (UNEXPECTED(ce == NULL)) {
    5601           0 :                                 zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
    5602           0 :                                 HANDLE_EXCEPTION();
    5603             :                         }
    5604        2790 :                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
    5605             :                 }
    5606             :         } else {
    5607             :                 ce = Z_CE_P(EX_VAR(opline->op1.var));
    5608             :         }
    5609             : 
    5610        5506 :         if (IS_CONST == IS_CONST &&
    5611             :             IS_CONST == IS_CONST &&
    5612        5506 :             EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
    5613             :                 /* nothing to do */
    5614        2801 :         } else if (IS_CONST != IS_CONST &&
    5615             :                    IS_CONST == IS_CONST &&
    5616             :                    (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce))) {
    5617             :                 /* do nothing */
    5618             :         } else if (IS_CONST != IS_UNUSED) {
    5619             : 
    5620             : 
    5621        2801 :                 function_name = EX_CONSTANT(opline->op2);
    5622        2801 :                 if (IS_CONST != IS_CONST) {
    5623             :                         if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
    5624             :                                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    5625             :                                         GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    5626             :                                 }
    5627             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    5628             :                                         HANDLE_EXCEPTION();
    5629             :                                 }
    5630             :                                 zend_throw_error(NULL, "Function name must be a string");
    5631             : 
    5632             :                                 HANDLE_EXCEPTION();
    5633             :                         }
    5634             :                 }
    5635             : 
    5636        2801 :                 if (ce->get_static_method) {
    5637           0 :                         fbc = ce->get_static_method(ce, Z_STR_P(function_name));
    5638             :                 } else {
    5639        2801 :                         fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
    5640             :                 }
    5641        2801 :                 if (UNEXPECTED(fbc == NULL)) {
    5642          11 :                         if (EXPECTED(!EG(exception))) {
    5643           4 :                                 zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name));
    5644             :                         }
    5645             : 
    5646          11 :                         HANDLE_EXCEPTION();
    5647             :                 }
    5648        5580 :                 if (IS_CONST == IS_CONST &&
    5649        2790 :                     EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
    5650        2790 :                     EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE)))) {
    5651             :                         if (IS_CONST == IS_CONST) {
    5652        2761 :                                 CACHE_PTR(Z_CACHE_SLOT_P(function_name), fbc);
    5653             :                         } else {
    5654             :                                 CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), ce, fbc);
    5655             :                         }
    5656             :                 }
    5657             :                 if (IS_CONST != IS_CONST) {
    5658             : 
    5659             :                 }
    5660             :         } else {
    5661             :                 if (UNEXPECTED(ce->constructor == NULL)) {
    5662             :                         zend_throw_error(NULL, "Cannot call constructor");
    5663             :                         HANDLE_EXCEPTION();
    5664             :                 }
    5665             :                 if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
    5666             :                         zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name));
    5667             :                         HANDLE_EXCEPTION();
    5668             :                 }
    5669             :                 fbc = ce->constructor;
    5670             :         }
    5671             : 
    5672        5495 :         object = NULL;
    5673        5495 :         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    5674          83 :                 if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
    5675          58 :                         object = Z_OBJ(EX(This));
    5676             :                 }
    5677          83 :                 if (!object) {
    5678          25 :                         if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    5679             :                                 /* Allowed for PHP 4 compatibility. */
    5680          34 :                                 zend_error(
    5681             :                                         E_DEPRECATED,
    5682             :                                         "Non-static method %s::%s() should not be called statically",
    5683          34 :                                         ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    5684          17 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    5685           1 :                                         HANDLE_EXCEPTION();
    5686             :                                 }
    5687             :                         } else {
    5688             :                                 /* An internal function assumes $this is present and won't check that.
    5689             :                                  * So PHP would crash by allowing the call. */
    5690          16 :                                 zend_throw_error(
    5691             :                                         zend_ce_error,
    5692             :                                         "Non-static method %s::%s() cannot be called statically",
    5693          16 :                                         ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    5694           8 :                                 HANDLE_EXCEPTION();
    5695             :                         }
    5696             :                 }
    5697             :         }
    5698             : 
    5699        5486 :         if (IS_CONST != IS_CONST) {
    5700             :                 /* previous opcode is ZEND_FETCH_CLASS */
    5701             :                 if (((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT ||
    5702             :                     ((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) {
    5703             :                         ce = EX(called_scope);
    5704             :                 }
    5705             :         }
    5706             : 
    5707       10972 :         call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
    5708             :                 fbc, opline->extended_value, ce, object);
    5709        5486 :         call->prev_execute_data = EX(call);
    5710        5486 :         EX(call) = call;
    5711             : 
    5712        5486 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5713             : }
    5714             : 
    5715          75 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5716             : {
    5717          75 :         USE_OPLINE
    5718             : 
    5719             :         zval *function_name;
    5720             :         zend_fcall_info_cache fcc;
    5721          75 :         char *error = NULL;
    5722             :         zend_function *func;
    5723             :         zend_class_entry *called_scope;
    5724             :         zend_object *object;
    5725             :         zend_execute_data *call;
    5726          75 :         uint32_t call_info = ZEND_CALL_NESTED_FUNCTION;
    5727             : 
    5728             :         SAVE_OPLINE();
    5729          75 :         function_name = EX_CONSTANT(opline->op2);
    5730          75 :         if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
    5731          66 :                 func = fcc.function_handler;
    5732          66 :                 if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
    5733             :                         /* Delay closure destruction until its invocation */
    5734           0 :                         if (IS_CONST & (IS_VAR|IS_CV)) {
    5735             :                                 ZVAL_DEREF(function_name);
    5736             :                         }
    5737             :                         ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
    5738           0 :                         GC_REFCOUNT((zend_object*)func->common.prototype)++;
    5739           0 :                         call_info |= ZEND_CALL_CLOSURE;
    5740             :                 }
    5741          66 :                 called_scope = fcc.called_scope;
    5742          66 :                 object = fcc.object;
    5743          66 :                 if (object) {
    5744          20 :                         call_info |= ZEND_CALL_RELEASE_THIS;
    5745          20 :                         GC_REFCOUNT(object)++; /* For $this pointer */
    5746             :                 }
    5747          66 :                 if (error) {
    5748           3 :                         efree(error);
    5749             :                         /* This is the only soft error is_callable() can generate */
    5750           6 :                         zend_error(E_DEPRECATED,
    5751             :                                 "Non-static method %s::%s() should not be called statically",
    5752           6 :                                 ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
    5753           3 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    5754           0 :                                 HANDLE_EXCEPTION();
    5755             :                         }
    5756             :                 }
    5757             :         } else {
    5758           9 :                 zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
    5759           9 :                 efree(error);
    5760           9 :                 func = (zend_function*)&zend_pass_function;
    5761           9 :                 called_scope = NULL;
    5762           9 :                 object = NULL;
    5763             :         }
    5764             : 
    5765         150 :         call = zend_vm_stack_push_call_frame(call_info,
    5766             :                 func, opline->extended_value, called_scope, object);
    5767          75 :         call->prev_execute_data = EX(call);
    5768          75 :         EX(call) = call;
    5769             : 
    5770          75 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5771             : }
    5772             : 
    5773          10 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5774             : {
    5775          10 :         USE_OPLINE
    5776             : 
    5777             :         zval *op1, *op2, *result;
    5778             : 
    5779          10 :         op1 = EX_CONSTANT(opline->op1);
    5780          10 :         op2 = EX_CONSTANT(opline->op2);
    5781             :         do {
    5782             :                 int result;
    5783             : 
    5784          10 :                 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
    5785          10 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    5786          10 :                                 result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
    5787           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    5788           0 :                                 result = ((double)Z_LVAL_P(op1) == Z_DVAL_P(op2));
    5789             :                         } else {
    5790           0 :                                 break;
    5791             :                         }
    5792           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
    5793           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    5794           0 :                                 result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
    5795           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    5796           0 :                                 result = (Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2)));
    5797             :                         } else {
    5798           0 :                                 break;
    5799             :                         }
    5800           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    5801           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    5802           0 :                                 if (Z_STR_P(op1) == Z_STR_P(op2)) {
    5803           0 :                                         result = 1;
    5804           0 :                                 } else if (Z_STRVAL_P(op1)[0] > '9' || Z_STRVAL_P(op2)[0] > '9') {
    5805           0 :                                         if (Z_STRLEN_P(op1) != Z_STRLEN_P(op2)) {
    5806           0 :                                                 result = 0;
    5807             :                                         } else {
    5808           0 :                                                 result = (memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) == 0);
    5809             :                                         }
    5810             :                                 } else {
    5811           0 :                                         result = (zendi_smart_strcmp(op1, op2) == 0);
    5812             :                                 }
    5813             : 
    5814             :                         } else {
    5815           0 :                                 break;
    5816             :                         }
    5817             :                 } else {
    5818           0 :                         break;
    5819             :                 }
    5820          10 :                 ZEND_VM_SMART_BRANCH(result, 0);
    5821           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    5822           0 :                 ZEND_VM_NEXT_OPCODE();
    5823             :         } while (0);
    5824             : 
    5825             :         SAVE_OPLINE();
    5826           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    5827             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    5828             :         }
    5829           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    5830             :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    5831             :         }
    5832           0 :         result = EX_VAR(opline->result.var);
    5833           0 :         compare_function(result, op1, op2);
    5834           0 :         ZVAL_BOOL(result, Z_LVAL_P(result) == 0);
    5835             : 
    5836           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5837             : }
    5838             : 
    5839         384 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5840             : {
    5841         384 :         USE_OPLINE
    5842             : 
    5843             :         SAVE_OPLINE();
    5844         384 :         if (IS_CONST == IS_UNUSED) {
    5845             :                 zend_constant *c;
    5846             : 
    5847             :                 if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
    5848             :                         c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    5849             :                 } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
    5850             :                         if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
    5851             :                                 char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
    5852             :                                 if (!actual) {
    5853             :                                         ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(EX_CONSTANT(opline->op2)));
    5854             :                                 } else {
    5855             :                                         actual++;
    5856             :                                         ZVAL_STRINGL(EX_VAR(opline->result.var),
    5857             :                                                         actual, Z_STRLEN_P(EX_CONSTANT(opline->op2)) - (actual - Z_STRVAL_P(EX_CONSTANT(opline->op2))));
    5858             :                                 }
    5859             :                                 /* non-qualified constant - allow text substitution */
    5860             :                                 zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
    5861             :                                                 Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
    5862             :                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    5863             :                         } else {
    5864             :                                 zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    5865             :                                 HANDLE_EXCEPTION();
    5866             :                         }
    5867             :                 } else {
    5868             :                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), c);
    5869             :                 }
    5870             : #ifdef ZTS
    5871             :                 if (c->flags & CONST_PERSISTENT) {
    5872             :                         ZVAL_DUP(EX_VAR(opline->result.var), &c->value);
    5873             :                 } else {
    5874             :                         ZVAL_COPY(EX_VAR(opline->result.var), &c->value);
    5875             :                 }
    5876             : #else
    5877             :                 ZVAL_COPY(EX_VAR(opline->result.var), &c->value);
    5878             : #endif
    5879             :         } else {
    5880             :                 /* class constant */
    5881             :                 zend_class_entry *ce;
    5882             :                 zval *value;
    5883             : 
    5884             :                 do {
    5885             :                         if (IS_CONST == IS_CONST) {
    5886         384 :                                 if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
    5887          51 :                                         value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    5888          51 :                                         ZVAL_DEREF(value);
    5889             : #ifdef ZTS
    5890             :                                         ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    5891             : #endif
    5892          51 :                                         break;
    5893         333 :                                 } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
    5894           0 :                                         ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    5895             :                                 } else {
    5896         333 :                                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    5897         333 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    5898           2 :                                                 HANDLE_EXCEPTION();
    5899             :                                         }
    5900         331 :                                         if (UNEXPECTED(ce == NULL)) {
    5901           0 :                                                 zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
    5902           0 :                                                 HANDLE_EXCEPTION();
    5903             :                                         }
    5904         331 :                                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
    5905             :                                 }
    5906             :                         } else {
    5907             :                                 ce = Z_CE_P(EX_VAR(opline->op1.var));
    5908             :                                 if ((value = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce)) != NULL) {
    5909             :                                         ZVAL_DEREF(value);
    5910             :                                         break;
    5911             :                                 }
    5912             :                         }
    5913             : 
    5914         331 :                         if (EXPECTED((value = zend_hash_find(&ce->constants_table, Z_STR_P(EX_CONSTANT(opline->op2)))) != NULL)) {
    5915         329 :                                 ZVAL_DEREF(value);
    5916         329 :                                 if (Z_CONSTANT_P(value)) {
    5917          20 :                                         EG(scope) = ce;
    5918          20 :                                         zval_update_constant_ex(value, 1, NULL);
    5919          20 :                                         EG(scope) = EX(func)->op_array.scope;
    5920          20 :                                         if (UNEXPECTED(EG(exception) != NULL)) {
    5921           3 :                                                 HANDLE_EXCEPTION();
    5922             :                                         }
    5923             :                                 }
    5924             :                                 if (IS_CONST == IS_CONST) {
    5925         326 :                                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), value);
    5926             :                                 } else {
    5927             :                                         CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value);
    5928             :                                 }
    5929             :                         } else {
    5930           2 :                                 zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    5931           2 :                                 HANDLE_EXCEPTION();
    5932             :                         }
    5933             :                 } while (0);
    5934             : #ifdef ZTS
    5935             :                 if (ce->type == ZEND_INTERNAL_CLASS) {
    5936             :                         ZVAL_DUP(EX_VAR(opline->result.var), value);
    5937             :                 } else {
    5938             :                         ZVAL_COPY(EX_VAR(opline->result.var), value);
    5939             :                 }
    5940             : #else
    5941         377 :                 ZVAL_COPY(EX_VAR(opline->result.var), value);
    5942             : #endif
    5943             :         }
    5944         377 :         ZEND_VM_NEXT_OPCODE();
    5945             : }
    5946             : 
    5947        5592 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    5948             : {
    5949        5592 :         USE_OPLINE
    5950             : 
    5951             :         zval *expr_ptr, new_expr;
    5952             : 
    5953             :         SAVE_OPLINE();
    5954        5592 :         if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
    5955             :             UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
    5956             :                 expr_ptr = NULL;
    5957             :                 if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
    5958             :                         zend_throw_error(NULL, "Cannot create references to/from string offsets");
    5959             :                         zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var)));
    5960             :                         HANDLE_EXCEPTION();
    5961             :                 }
    5962             :                 ZVAL_MAKE_REF(expr_ptr);
    5963             :                 Z_ADDREF_P(expr_ptr);
    5964             : 
    5965             :         } else {
    5966        5592 :                 expr_ptr = EX_CONSTANT(opline->op1);
    5967        5592 :                 if (IS_CONST == IS_TMP_VAR) {
    5968             :                         /* pass */
    5969             :                 } else if (IS_CONST == IS_CONST) {
    5970        5592 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(expr_ptr))) {
    5971         438 :                                 ZVAL_COPY_VALUE(&new_expr, expr_ptr);
    5972         438 :                                 zval_copy_ctor_func(&new_expr);
    5973         438 :                                 expr_ptr = &new_expr;
    5974             :                         }
    5975             :                 } else if (IS_CONST == IS_CV) {
    5976             :                         ZVAL_DEREF(expr_ptr);
    5977             :                         if (Z_REFCOUNTED_P(expr_ptr)) {
    5978             :                                 Z_ADDREF_P(expr_ptr);
    5979             :                         }
    5980             :                 } else /* if (IS_CONST == IS_VAR) */ {
    5981             :                         if (UNEXPECTED(Z_ISREF_P(expr_ptr))) {
    5982             :                                 zend_refcounted *ref = Z_COUNTED_P(expr_ptr);
    5983             : 
    5984             :                                 expr_ptr = Z_REFVAL_P(expr_ptr);
    5985             :                                 if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
    5986             :                                         ZVAL_COPY_VALUE(&new_expr, expr_ptr);
    5987             :                                         expr_ptr = &new_expr;
    5988             :                                         efree_size(ref, sizeof(zend_reference));
    5989             :                                 } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) {
    5990             :                                         Z_ADDREF_P(expr_ptr);
    5991             :                                 }
    5992             :                         }
    5993             :                 }
    5994             :         }
    5995             : 
    5996             :         if (IS_CONST != IS_UNUSED) {
    5997             : 
    5998        5592 :                 zval *offset = EX_CONSTANT(opline->op2);
    5999             :                 zend_string *str;
    6000             :                 zend_ulong hval;
    6001             : 
    6002             : add_again:
    6003        5592 :                 if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) {
    6004        5340 :                         str = Z_STR_P(offset);
    6005        5340 :                         if (IS_CONST != IS_CONST) {
    6006             :                                 if (ZEND_HANDLE_NUMERIC(str, hval)) {
    6007             :                                         goto num_index;
    6008             :                                 }
    6009             :                         }
    6010             : str_index:
    6011        5349 :                         zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
    6012         252 :                 } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) {
    6013         218 :                         hval = Z_LVAL_P(offset);
    6014             : num_index:
    6015         243 :                         zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
    6016          34 :                 } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) {
    6017             :                         offset = Z_REFVAL_P(offset);
    6018             :                         goto add_again;
    6019          34 :                 } else if (Z_TYPE_P(offset) == IS_NULL) {
    6020           9 :                         str = ZSTR_EMPTY_ALLOC();
    6021           9 :                         goto str_index;
    6022          25 :                 } else if (Z_TYPE_P(offset) == IS_DOUBLE) {
    6023          26 :                         hval = zend_dval_to_lval(Z_DVAL_P(offset));
    6024          13 :                         goto num_index;
    6025          12 :                 } else if (Z_TYPE_P(offset) == IS_FALSE) {
    6026           7 :                         hval = 0;
    6027           7 :                         goto num_index;
    6028           5 :                 } else if (Z_TYPE_P(offset) == IS_TRUE) {
    6029           5 :                         hval = 1;
    6030           5 :                         goto num_index;
    6031           0 :                 } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) {
    6032             :                         GET_OP2_UNDEF_CV(offset, BP_VAR_R);
    6033             :                         str = ZSTR_EMPTY_ALLOC();
    6034             :                         goto str_index;
    6035             :                 } else {
    6036           0 :                         zend_error(E_WARNING, "Illegal offset type");
    6037             :                         zval_ptr_dtor(expr_ptr);
    6038             :                 }
    6039             : 
    6040             :         } else {
    6041             :                 zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
    6042             :         }
    6043        5592 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6044             : }
    6045             : 
    6046         589 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6047             : {
    6048             :         zval *array;
    6049             :         uint32_t size;
    6050         589 :         USE_OPLINE
    6051             : 
    6052         589 :         array = EX_VAR(opline->result.var);
    6053             :         if (IS_CONST != IS_UNUSED) {
    6054         589 :                 size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
    6055             :         } else {
    6056             :                 size = 0;
    6057             :         }
    6058         589 :         ZVAL_NEW_ARR(array);
    6059         589 :         zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
    6060             : 
    6061             :         if (IS_CONST != IS_UNUSED) {
    6062             :                 /* Explicitly initialize array as not-packed if flag is set */
    6063         589 :                 if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
    6064         569 :                         zend_hash_real_init(Z_ARRVAL_P(array), 0);
    6065             :                 }
    6066             :         }
    6067             : 
    6068         589 :         if (IS_CONST == IS_UNUSED) {
    6069             :                 ZEND_VM_NEXT_OPCODE();
    6070             : #if 0 || (IS_CONST != IS_UNUSED)
    6071             :         } else {
    6072         589 :                 ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    6073             : #endif
    6074             :         }
    6075             : }
    6076             : 
    6077           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6078             : {
    6079           2 :         USE_OPLINE
    6080             :         zval tmp, *varname;
    6081             :         HashTable *target_symbol_table;
    6082             : 
    6083             : 
    6084             :         SAVE_OPLINE();
    6085           2 :         if (IS_CONST == IS_CV &&
    6086             :             IS_CONST == IS_UNUSED &&
    6087             :             (opline->extended_value & ZEND_QUICK_SET)) {
    6088             :                 zval *var = EX_VAR(opline->op1.var);
    6089             : 
    6090             :                 if (Z_REFCOUNTED_P(var)) {
    6091             :                         zend_refcounted *garbage = Z_COUNTED_P(var);
    6092             : 
    6093             :                         if (!--GC_REFCOUNT(garbage)) {
    6094             :                                 ZVAL_UNDEF(var);
    6095             :                                 zval_dtor_func_for_ptr(garbage);
    6096             :                         } else {
    6097             :                                 GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
    6098             :                                 ZVAL_UNDEF(var);
    6099             :                         }
    6100             :                 } else {
    6101             :                         ZVAL_UNDEF(var);
    6102             :                 }
    6103             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6104             :         }
    6105             : 
    6106           2 :         varname = EX_CONSTANT(opline->op1);
    6107             : 
    6108           2 :         ZVAL_UNDEF(&tmp);
    6109           2 :         if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
    6110             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) {
    6111             :                         varname = GET_OP1_UNDEF_CV(varname, BP_VAR_R);
    6112             :                 }
    6113             :                 ZVAL_STR(&tmp, zval_get_string(varname));
    6114             :                 varname = &tmp;
    6115             :         }
    6116             : 
    6117             :         if (IS_CONST != IS_UNUSED) {
    6118             :                 zend_class_entry *ce;
    6119             : 
    6120             :                 if (IS_CONST == IS_CONST) {
    6121           2 :                         ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    6122           2 :                         if (UNEXPECTED(ce == NULL)) {
    6123           2 :                                 ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    6124           2 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    6125           1 :                                         if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    6126             :                                                 zend_string_release(Z_STR(tmp));
    6127             :                                         }
    6128             : 
    6129           1 :                                         HANDLE_EXCEPTION();
    6130             :                                 }
    6131           1 :                                 if (UNEXPECTED(ce == NULL)) {
    6132           0 :                                         zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    6133           0 :                                         if (IS_CONST != IS_CONST) {
    6134             :                                                 zend_string_release(Z_STR(tmp));
    6135             :                                         }
    6136           0 :                                         HANDLE_EXCEPTION();
    6137             :                                 }
    6138           1 :                                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    6139             :                         }
    6140             :                 } else {
    6141             :                         ce = Z_CE_P(EX_VAR(opline->op2.var));
    6142             :                 }
    6143           1 :                 zend_std_unset_static_property(ce, Z_STR_P(varname));
    6144             :         } else {
    6145             :                 target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    6146             :                 zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
    6147             :         }
    6148             : 
    6149           1 :         if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    6150             :                 zend_string_release(Z_STR(tmp));
    6151             :         }
    6152             : 
    6153           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6154             : }
    6155             : 
    6156          47 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6157             : {
    6158          47 :         USE_OPLINE
    6159             :         zval *value;
    6160             :         int result;
    6161             : 
    6162          47 :         if (IS_CONST == IS_CV &&
    6163             :             IS_CONST == IS_UNUSED &&
    6164             :             (opline->extended_value & ZEND_QUICK_SET)) {
    6165             :                 value = EX_VAR(opline->op1.var);
    6166             :                 if (opline->extended_value & ZEND_ISSET) {
    6167             :                         result =
    6168             :                                 Z_TYPE_P(value) > IS_NULL &&
    6169             :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    6170             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    6171             :                         SAVE_OPLINE();
    6172             :                         result = !i_zend_is_true(value);
    6173             :                         if (UNEXPECTED(EG(exception))) {
    6174             :                                 HANDLE_EXCEPTION();
    6175             :                         }
    6176             :                 }
    6177             :                 ZEND_VM_SMART_BRANCH(result, 0);
    6178             :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6179             :                 ZEND_VM_SET_NEXT_OPCODE(opline + 1);
    6180             :                 ZEND_VM_CONTINUE();
    6181             :         } else {
    6182             : 
    6183             :                 zval tmp, *varname;
    6184             : 
    6185             :                 SAVE_OPLINE();
    6186          47 :                 varname = EX_CONSTANT(opline->op1);
    6187          47 :                 ZVAL_UNDEF(&tmp);
    6188          47 :                 if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
    6189             :                         ZVAL_STR(&tmp, zval_get_string(varname));
    6190             :                         varname = &tmp;
    6191             :                 }
    6192             : 
    6193             :                 if (IS_CONST != IS_UNUSED) {
    6194             :                         zend_class_entry *ce;
    6195             : 
    6196             :                         if (IS_CONST == IS_CONST) {
    6197          47 :                                 if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
    6198          13 :                                         value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
    6199             : 
    6200             :                                         /* check if static properties were destoyed */
    6201          13 :                                         if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    6202           0 :                                                 value = NULL;
    6203             :                                         }
    6204             : 
    6205          13 :                                         goto is_var_return;
    6206          34 :                                 } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
    6207          29 :                                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    6208          29 :                                         if (UNEXPECTED(ce == NULL)) {
    6209           1 :                                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6210             :                                         }
    6211          28 :                                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    6212             :                                 }
    6213             :                         } else {
    6214             :                                 ce = Z_CE_P(EX_VAR(opline->op2.var));
    6215             :                                 if (IS_CONST == IS_CONST &&
    6216             :                                     (value = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce)) != NULL) {
    6217             : 
    6218             :                                         /* check if static properties were destoyed */
    6219             :                                         if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    6220             :                                                 value = NULL;
    6221             :                                         }
    6222             : 
    6223             :                                         goto is_var_return;
    6224             :                                 }
    6225             :                         }
    6226             : 
    6227          33 :                         value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
    6228             : 
    6229          33 :                         if (IS_CONST == IS_CONST && value) {
    6230          11 :                                 CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
    6231             :                         }
    6232             :                 } else {
    6233             :                         HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    6234             :                         value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
    6235             :                 }
    6236             : 
    6237          33 :                 if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    6238             :                         zend_string_release(Z_STR(tmp));
    6239             :                 }
    6240             : 
    6241             : is_var_return:
    6242          46 :                 if (opline->extended_value & ZEND_ISSET) {
    6243         104 :                         result = value && Z_TYPE_P(value) > IS_NULL &&
    6244          11 :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    6245             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    6246           0 :                         result = !value || !i_zend_is_true(value);
    6247             :                 }
    6248             : 
    6249          46 :                 ZEND_VM_SMART_BRANCH(result, 1);
    6250          46 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6251          46 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6252             :         }
    6253             : }
    6254             : 
    6255           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6256             : {
    6257           2 :         USE_OPLINE
    6258             : 
    6259             :         zval *container;
    6260             :         int result;
    6261             :         zend_ulong hval;
    6262             :         zval *offset;
    6263             : 
    6264             :         SAVE_OPLINE();
    6265           2 :         container = EX_CONSTANT(opline->op1);
    6266             : 
    6267           2 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    6268             :                 zend_throw_error(NULL, "Using $this when not in object context");
    6269             : 
    6270             :                 HANDLE_EXCEPTION();
    6271             :         }
    6272             : 
    6273           2 :         offset = EX_CONSTANT(opline->op2);
    6274             : 
    6275           2 :         if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
    6276             :                 HashTable *ht;
    6277             :                 zval *value;
    6278             :                 zend_string *str;
    6279             : 
    6280             : isset_dim_obj_array:
    6281           2 :                 ht = Z_ARRVAL_P(container);
    6282             : isset_again:
    6283           2 :                 if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) {
    6284           0 :                         str = Z_STR_P(offset);
    6285           0 :                         if (IS_CONST != IS_CONST) {
    6286             :                                 if (ZEND_HANDLE_NUMERIC(str, hval)) {
    6287             :                                         goto num_index_prop;
    6288             :                                 }
    6289             :                         }
    6290             : str_index_prop:
    6291           0 :                         value = zend_hash_find_ind(ht, str);
    6292           2 :                 } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) {
    6293           2 :                         hval = Z_LVAL_P(offset);
    6294             : num_index_prop:
    6295           2 :                         value = zend_hash_index_find(ht, hval);
    6296           0 :                 } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) {
    6297             :                         offset = Z_REFVAL_P(offset);
    6298             :                         goto isset_again;
    6299           0 :                 } else if (Z_TYPE_P(offset) == IS_DOUBLE) {
    6300           0 :                         hval = zend_dval_to_lval(Z_DVAL_P(offset));
    6301           0 :                         goto num_index_prop;
    6302           0 :                 } else if (Z_TYPE_P(offset) == IS_NULL) {
    6303           0 :                         str = ZSTR_EMPTY_ALLOC();
    6304           0 :                         goto str_index_prop;
    6305           0 :                 } else if (Z_TYPE_P(offset) == IS_FALSE) {
    6306           0 :                         hval = 0;
    6307           0 :                         goto num_index_prop;
    6308           0 :                 } else if (Z_TYPE_P(offset) == IS_TRUE) {
    6309           0 :                         hval = 1;
    6310           0 :                         goto num_index_prop;
    6311           0 :                 } else if (Z_TYPE_P(offset) == IS_RESOURCE) {
    6312           0 :                         hval = Z_RES_HANDLE_P(offset);
    6313           0 :                         goto num_index_prop;
    6314           0 :                 } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) {
    6315             :                         GET_OP2_UNDEF_CV(offset, BP_VAR_R);
    6316             :                         str = ZSTR_EMPTY_ALLOC();
    6317             :                         goto str_index_prop;
    6318             :                 } else {
    6319           0 :                         zend_error(E_WARNING, "Illegal offset type in isset or empty");
    6320           0 :                         goto isset_not_found;
    6321             :                 }
    6322             : 
    6323           2 :                 if (opline->extended_value & ZEND_ISSET) {
    6324             :                         /* > IS_NULL means not IS_UNDEF and not IS_NULL */
    6325           6 :                         result = value != NULL && Z_TYPE_P(value) > IS_NULL &&
    6326           0 :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    6327             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    6328           0 :                         result = (value == NULL || !i_zend_is_true(value));
    6329             :                 }
    6330           2 :                 goto isset_dim_obj_exit;
    6331           0 :         } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
    6332             :                 container = Z_REFVAL_P(container);
    6333             :                 if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
    6334             :                         goto isset_dim_obj_array;
    6335             :                 }
    6336             :         }
    6337             : 
    6338           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) {
    6339             :                 offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R);
    6340             :         }
    6341             : 
    6342           0 :         if (IS_CONST == IS_UNUSED ||
    6343             :             (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) {
    6344             :                 if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) {
    6345             :                         result =
    6346             :                                 ((opline->extended_value & ZEND_ISSET) == 0) ^
    6347             :                                 Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0);
    6348             :                 } else {
    6349             :                         zend_error(E_NOTICE, "Trying to check element of non-array");
    6350             :                         goto isset_not_found;
    6351             :                 }
    6352           0 :         } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */
    6353             :                 zend_long lval;
    6354             : 
    6355           0 :                 if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) {
    6356           0 :                         lval = Z_LVAL_P(offset);
    6357             : isset_str_offset:
    6358           0 :                         if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) {
    6359           0 :                                 if (opline->extended_value & ZEND_ISSET) {
    6360           0 :                                         result = 1;
    6361             :                                 } else {
    6362           0 :                                         result = (Z_STRVAL_P(container)[lval] == '0');
    6363             :                                 }
    6364             :                         } else {
    6365             :                                 goto isset_not_found;
    6366             :                         }
    6367             :                 } else {
    6368           0 :                         if (IS_CONST & (IS_CV|IS_VAR)) {
    6369             :                                 ZVAL_DEREF(offset);
    6370             :                         }
    6371           0 :                         if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */
    6372             :                                         || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
    6373           0 :                                                 && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
    6374           0 :                                 lval = zval_get_long(offset);
    6375           0 :                                 goto isset_str_offset;
    6376             :                         }
    6377           0 :                         goto isset_not_found;
    6378             :                 }
    6379             :         } else {
    6380             : isset_not_found:
    6381           0 :                 result = ((opline->extended_value & ZEND_ISSET) == 0);
    6382             :         }
    6383             : 
    6384             : isset_dim_obj_exit:
    6385             : 
    6386             : 
    6387           2 :         ZEND_VM_SMART_BRANCH(result, 1);
    6388           2 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6389           2 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6390             : }
    6391             : 
    6392           3 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6393             : {
    6394           3 :         USE_OPLINE
    6395             : 
    6396             :         zval *container;
    6397             :         int result;
    6398             :         zval *offset;
    6399             : 
    6400             :         SAVE_OPLINE();
    6401           3 :         container = EX_CONSTANT(opline->op1);
    6402             : 
    6403           3 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    6404             :                 zend_throw_error(NULL, "Using $this when not in object context");
    6405             : 
    6406             :                 HANDLE_EXCEPTION();
    6407             :         }
    6408             : 
    6409           3 :         offset = EX_CONSTANT(opline->op2);
    6410             : 
    6411             :         if (IS_CONST == IS_CONST ||
    6412             :             (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
    6413           3 :                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
    6414             :                         container = Z_REFVAL_P(container);
    6415             :                         if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
    6416             :                                 goto isset_no_object;
    6417             :                         }
    6418             :                 } else {
    6419           3 :                         goto isset_no_object;
    6420             :                 }
    6421             :         }
    6422             :         if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) {
    6423             :                 zend_error(E_NOTICE, "Trying to check property of non-object");
    6424             : isset_no_object:
    6425           3 :                 result = ((opline->extended_value & ZEND_ISSET) == 0);
    6426             :         } else {
    6427             :                 result =
    6428             :                         ((opline->extended_value & ZEND_ISSET) == 0) ^
    6429             :                         Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL));
    6430             :         }
    6431             : 
    6432             : 
    6433           3 :         ZEND_VM_SMART_BRANCH(result, 1);
    6434           3 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6435           3 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6436             : }
    6437             : 
    6438         188 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6439             : {
    6440         188 :         USE_OPLINE
    6441             : 
    6442             :         zval *name;
    6443             :         zval *val;
    6444             :         zend_constant c;
    6445             : 
    6446             :         SAVE_OPLINE();
    6447         188 :         name  = EX_CONSTANT(opline->op1);
    6448         188 :         val   = EX_CONSTANT(opline->op2);
    6449             : 
    6450         188 :         ZVAL_COPY_VALUE(&c.value, val);
    6451         188 :         if (Z_OPT_CONSTANT(c.value)) {
    6452          29 :                 if (UNEXPECTED(zval_update_constant_ex(&c.value, 0, NULL) != SUCCESS)) {
    6453             : 
    6454             : 
    6455           1 :                         HANDLE_EXCEPTION();
    6456             :                 }
    6457             :         } else {
    6458             :                 /* IS_CONST can't be IS_OBJECT, IS_RESOURCE or IS_REFERENCE */
    6459         159 :                 if (UNEXPECTED(Z_OPT_COPYABLE(c.value))) {
    6460           5 :                         zval_copy_ctor_func(&c.value);
    6461             :                 }
    6462             :         }
    6463         187 :         c.flags = CONST_CS; /* non persistent, case sensetive */
    6464         374 :         c.name = zend_string_dup(Z_STR_P(name), 0);
    6465         187 :         c.module_number = PHP_USER_CONSTANT;
    6466             : 
    6467         187 :         if (zend_register_constant(&c) == FAILURE) {
    6468             :         }
    6469             : 
    6470             : 
    6471         187 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6472             : }
    6473             : 
    6474          22 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6475             : {
    6476          22 :         USE_OPLINE
    6477             : 
    6478          22 :         zend_generator *generator = zend_get_running_generator(execute_data);
    6479             : 
    6480             :         SAVE_OPLINE();
    6481          22 :         if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
    6482           0 :                 zend_throw_error(NULL, "Cannot yield from finally in a force-closed generator");
    6483             : 
    6484             : 
    6485           0 :                 HANDLE_EXCEPTION();
    6486             :         }
    6487             : 
    6488             :         /* Destroy the previously yielded value */
    6489          22 :         zval_ptr_dtor(&generator->value);
    6490             : 
    6491             :         /* Destroy the previously yielded key */
    6492          22 :         zval_ptr_dtor(&generator->key);
    6493             : 
    6494             :         /* Set the new yielded value */
    6495             :         if (IS_CONST != IS_UNUSED) {
    6496             : 
    6497             : 
    6498          22 :                 if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
    6499             :                         /* Constants and temporary variables aren't yieldable by reference,
    6500             :                          * but we still allow them with a notice. */
    6501             :                         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    6502             :                                 zval *value;
    6503             : 
    6504           0 :                                 zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    6505             : 
    6506           0 :                                 value = EX_CONSTANT(opline->op1);
    6507           0 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6508           0 :                                 if (IS_CONST != IS_CONST) {
    6509             :                                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    6510             :                                                 zval_copy_ctor_func(&generator->value);
    6511             :                                         }
    6512             :                                 }
    6513             :                         } else {
    6514             :                                 zval *value_ptr = NULL;
    6515             : 
    6516             :                                 if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
    6517             :                                         zend_throw_error(NULL, "Cannot yield string offsets by reference");
    6518             : 
    6519             :                                         HANDLE_EXCEPTION();
    6520             :                                 }
    6521             : 
    6522             :                                 /* If a function call result is yielded and the function did
    6523             :                                  * not return by reference we throw a notice. */
    6524             :                                 if (IS_CONST == IS_VAR &&
    6525             :                                     (value_ptr == &EG(uninitialized_zval) ||
    6526             :                                      (opline->extended_value == ZEND_RETURNS_FUNCTION &&
    6527             :                                       !(Z_VAR_FLAGS_P(value_ptr) & IS_VAR_RET_REF)))) {
    6528             :                                         zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    6529             :                                 } else {
    6530             :                                         ZVAL_MAKE_REF(value_ptr);
    6531             :                                 }
    6532             :                                 ZVAL_COPY(&generator->value, value_ptr);
    6533             : 
    6534             :                         }
    6535             :                 } else {
    6536          22 :                         zval *value = EX_CONSTANT(opline->op1);
    6537             : 
    6538             :                         /* Consts, temporary variables and references need copying */
    6539             :                         if (IS_CONST == IS_CONST) {
    6540          22 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6541          22 :                                 if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    6542           1 :                                         zval_copy_ctor_func(&generator->value);
    6543             :                                 }
    6544             :                         } else if (IS_CONST == IS_TMP_VAR) {
    6545             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6546             :             } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) {
    6547             :                                 ZVAL_COPY(&generator->value, Z_REFVAL_P(value));
    6548             : 
    6549             :                         } else {
    6550             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6551             :                                 if (IS_CONST == IS_CV) {
    6552             :                                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    6553             :                                 }
    6554             :                         }
    6555             :                 }
    6556             :         } else {
    6557             :                 /* If no value was specified yield null */
    6558             :                 ZVAL_NULL(&generator->value);
    6559             :         }
    6560             : 
    6561             :         /* Set the new yielded key */
    6562             :         if (IS_CONST != IS_UNUSED) {
    6563             : 
    6564          22 :                 zval *key = EX_CONSTANT(opline->op2);
    6565             : 
    6566             :                 /* Consts, temporary variables and references need copying */
    6567             :                 if (IS_CONST == IS_CONST) {
    6568          22 :                         ZVAL_COPY_VALUE(&generator->key, key);
    6569          22 :                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->key))) {
    6570           3 :                                 zval_copy_ctor_func(&generator->key);
    6571             :                         }
    6572             :                 } else if (IS_CONST == IS_TMP_VAR) {
    6573             :                         ZVAL_COPY_VALUE(&generator->key, key);
    6574             :                 } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(key)) {
    6575             :                         ZVAL_COPY(&generator->key, Z_REFVAL_P(key));
    6576             : 
    6577             :                 } else {
    6578             :                         ZVAL_COPY_VALUE(&generator->key, key);
    6579             :                         if (IS_CONST == IS_CV) {
    6580             :                                 if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key);
    6581             :                         }
    6582             :                 }
    6583             : 
    6584          46 :                 if (Z_TYPE(generator->key) == IS_LONG
    6585           2 :                     && Z_LVAL(generator->key) > generator->largest_used_integer_key
    6586             :                 ) {
    6587           2 :                         generator->largest_used_integer_key = Z_LVAL(generator->key);
    6588             :                 }
    6589             :         } else {
    6590             :                 /* If no key was specified we use auto-increment keys */
    6591             :                 generator->largest_used_integer_key++;
    6592             :                 ZVAL_LONG(&generator->key, generator->largest_used_integer_key);
    6593             :         }
    6594             : 
    6595          22 :         if (RETURN_VALUE_USED(opline)) {
    6596             :                 /* If the return value of yield is used set the send
    6597             :                  * target and initialize it to NULL */
    6598           4 :                 generator->send_target = EX_VAR(opline->result.var);
    6599           4 :                 ZVAL_NULL(generator->send_target);
    6600             :         } else {
    6601          18 :                 generator->send_target = NULL;
    6602             :         }
    6603             : 
    6604             :         /* We increment to the next op, so we are at the correct position when the
    6605             :          * generator is resumed. */
    6606          22 :         ZEND_VM_INC_OPCODE();
    6607             : 
    6608             :         /* The GOTO VM uses a local opline variable. We need to set the opline
    6609             :          * variable in execute_data so we don't resume at an old position. */
    6610             :         SAVE_OPLINE();
    6611             : 
    6612          22 :         ZEND_VM_RETURN();
    6613             : }
    6614             : 
    6615           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6616             : {
    6617           0 :         USE_OPLINE
    6618             : 
    6619             :         zval *op1, *op2;
    6620             : 
    6621             :         SAVE_OPLINE();
    6622           0 :         op1 = EX_CONSTANT(opline->op1);
    6623           0 :         op2 = EX_CONSTANT(opline->op2);
    6624           0 :         pow_function(EX_VAR(opline->result.var), op1, op2);
    6625             : 
    6626             : 
    6627           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6628             : }
    6629             : 
    6630           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6631             : {
    6632           0 :         USE_OPLINE
    6633             :         zend_free_op free_op2;
    6634             :         zval *op1, *op2;
    6635             :         int result;
    6636             : 
    6637             :         SAVE_OPLINE();
    6638           0 :         op1 = EX_CONSTANT(opline->op1);
    6639           0 :         op2 = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
    6640           0 :         result = fast_is_identical_function(op1, op2);
    6641             : 
    6642           0 :         zval_ptr_dtor_nogc(free_op2);
    6643           0 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
    6644           0 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6645             :         if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
    6646           0 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6647             :         }
    6648             :         ZEND_VM_NEXT_OPCODE();
    6649             : }
    6650             : 
    6651           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6652             : {
    6653           0 :         USE_OPLINE
    6654             :         zend_free_op free_op2;
    6655             :         zval *op1, *op2;
    6656             :         int result;
    6657             : 
    6658             :         SAVE_OPLINE();
    6659           0 :         op1 = EX_CONSTANT(opline->op1);
    6660           0 :         op2 = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
    6661           0 :         result = fast_is_not_identical_function(op1, op2);
    6662             : 
    6663           0 :         zval_ptr_dtor_nogc(free_op2);
    6664           0 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
    6665           0 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6666             :         if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
    6667           0 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6668             :         }
    6669             :         ZEND_VM_NEXT_OPCODE();
    6670             : }
    6671             : 
    6672           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6673             : {
    6674           0 :         USE_OPLINE
    6675             : 
    6676           0 :         zend_generator *generator = zend_get_running_generator(execute_data);
    6677             : 
    6678             :         SAVE_OPLINE();
    6679           0 :         if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
    6680           0 :                 zend_throw_error(NULL, "Cannot yield from finally in a force-closed generator");
    6681           0 :                 zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
    6682             : 
    6683           0 :                 HANDLE_EXCEPTION();
    6684             :         }
    6685             : 
    6686             :         /* Destroy the previously yielded value */
    6687           0 :         zval_ptr_dtor(&generator->value);
    6688             : 
    6689             :         /* Destroy the previously yielded key */
    6690           0 :         zval_ptr_dtor(&generator->key);
    6691             : 
    6692             :         /* Set the new yielded value */
    6693             :         if (IS_CONST != IS_UNUSED) {
    6694             : 
    6695             : 
    6696           0 :                 if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
    6697             :                         /* Constants and temporary variables aren't yieldable by reference,
    6698             :                          * but we still allow them with a notice. */
    6699             :                         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    6700             :                                 zval *value;
    6701             : 
    6702           0 :                                 zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    6703             : 
    6704           0 :                                 value = EX_CONSTANT(opline->op1);
    6705           0 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6706           0 :                                 if (IS_CONST != IS_CONST) {
    6707             :                                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    6708             :                                                 zval_copy_ctor_func(&generator->value);
    6709             :                                         }
    6710             :                                 }
    6711             :                         } else {
    6712             :                                 zval *value_ptr = NULL;
    6713             : 
    6714             :                                 if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
    6715             :                                         zend_throw_error(NULL, "Cannot yield string offsets by reference");
    6716             :                                         zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
    6717             :                                         HANDLE_EXCEPTION();
    6718             :                                 }
    6719             : 
    6720             :                                 /* If a function call result is yielded and the function did
    6721             :                                  * not return by reference we throw a notice. */
    6722             :                                 if (IS_CONST == IS_VAR &&
    6723             :                                     (value_ptr == &EG(uninitialized_zval) ||
    6724             :                                      (opline->extended_value == ZEND_RETURNS_FUNCTION &&
    6725             :                                       !(Z_VAR_FLAGS_P(value_ptr) & IS_VAR_RET_REF)))) {
    6726             :                                         zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    6727             :                                 } else {
    6728             :                                         ZVAL_MAKE_REF(value_ptr);
    6729             :                                 }
    6730             :                                 ZVAL_COPY(&generator->value, value_ptr);
    6731             : 
    6732             :                         }
    6733             :                 } else {
    6734           0 :                         zval *value = EX_CONSTANT(opline->op1);
    6735             : 
    6736             :                         /* Consts, temporary variables and references need copying */
    6737             :                         if (IS_CONST == IS_CONST) {
    6738           0 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6739           0 :                                 if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    6740           0 :                                         zval_copy_ctor_func(&generator->value);
    6741             :                                 }
    6742             :                         } else if (IS_CONST == IS_TMP_VAR) {
    6743             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6744             :             } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) {
    6745             :                                 ZVAL_COPY(&generator->value, Z_REFVAL_P(value));
    6746             : 
    6747             :                         } else {
    6748             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    6749             :                                 if (IS_CONST == IS_CV) {
    6750             :                                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    6751             :                                 }
    6752             :                         }
    6753             :                 }
    6754             :         } else {
    6755             :                 /* If no value was specified yield null */
    6756             :                 ZVAL_NULL(&generator->value);
    6757             :         }
    6758             : 
    6759             :         /* Set the new yielded key */
    6760             :         if (IS_TMP_VAR != IS_UNUSED) {
    6761             :                 zend_free_op free_op2;
    6762           0 :                 zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2);
    6763             : 
    6764             :                 /* Consts, temporary variables and references need copying */
    6765           0 :                 if (IS_TMP_VAR == IS_CONST) {
    6766             :                         ZVAL_COPY_VALUE(&generator->key, key);
    6767             :                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->key))) {
    6768             :                                 zval_copy_ctor_func(&generator->key);
    6769             :                         }
    6770             :                 } else if (IS_TMP_VAR == IS_TMP_VAR) {
    6771           0 :                         ZVAL_COPY_VALUE(&generator->key, key);
    6772             :                 } else if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(key)) {
    6773             :                         ZVAL_COPY(&generator->key, Z_REFVAL_P(key));
    6774             : 
    6775             :                 } else {
    6776             :                         ZVAL_COPY_VALUE(&generator->key, key);
    6777             :                         if (IS_TMP_VAR == IS_CV) {
    6778             :                                 if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key);
    6779             :                         }
    6780             :                 }
    6781             : 
    6782           0 :                 if (Z_TYPE(generator->key) == IS_LONG
    6783           0 :                     && Z_LVAL(generator->key) > generator->largest_used_integer_key
    6784             :                 ) {
    6785           0 :                         generator->largest_used_integer_key = Z_LVAL(generator->key);
    6786             :                 }
    6787             :         } else {
    6788             :                 /* If no key was specified we use auto-increment keys */
    6789             :                 generator->largest_used_integer_key++;
    6790             :                 ZVAL_LONG(&generator->key, generator->largest_used_integer_key);
    6791             :         }
    6792             : 
    6793           0 :         if (RETURN_VALUE_USED(opline)) {
    6794             :                 /* If the return value of yield is used set the send
    6795             :                  * target and initialize it to NULL */
    6796           0 :                 generator->send_target = EX_VAR(opline->result.var);
    6797           0 :                 ZVAL_NULL(generator->send_target);
    6798             :         } else {
    6799           0 :                 generator->send_target = NULL;
    6800             :         }
    6801             : 
    6802             :         /* We increment to the next op, so we are at the correct position when the
    6803             :          * generator is resumed. */
    6804           0 :         ZEND_VM_INC_OPCODE();
    6805             : 
    6806             :         /* The GOTO VM uses a local opline variable. We need to set the opline
    6807             :          * variable in execute_data so we don't resume at an old position. */
    6808             :         SAVE_OPLINE();
    6809             : 
    6810           0 :         ZEND_VM_RETURN();
    6811             : }
    6812             : 
    6813       21162 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6814             : {
    6815       21162 :         USE_OPLINE
    6816             :         zend_free_op free_op2;
    6817             :         zval *op1, *op2;
    6818             :         int result;
    6819             : 
    6820             :         SAVE_OPLINE();
    6821       21162 :         op1 = EX_CONSTANT(opline->op1);
    6822       42324 :         op2 = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
    6823       21162 :         result = fast_is_identical_function(op1, op2);
    6824             : 
    6825       21162 :         zval_ptr_dtor_nogc(free_op2);
    6826       21162 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
    6827          19 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6828             :         if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
    6829          19 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6830             :         }
    6831             :         ZEND_VM_NEXT_OPCODE();
    6832             : }
    6833             : 
    6834        7180 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    6835             : {
    6836        7180 :         USE_OPLINE
    6837             :         zend_free_op free_op2;
    6838             :         zval *op1, *op2;
    6839             :         int result;
    6840             : 
    6841             :         SAVE_OPLINE();
    6842        7180 :         op1 = EX_CONSTANT(opline->op1);
    6843       14360 :         op2 = _get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2);
    6844        7180 :         result = fast_is_not_identical_function(op1, op2);
    6845             : 
    6846        7180 :         zval_ptr_dtor_nogc(free_op2);
    6847        7180 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
    6848          28 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    6849             :         if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
    6850          28 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6851             :         }
    6852             :         ZEND_VM_NEXT_OPCODE();
    6853             : }
    6854             : 
    6855         781 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
    6856             : {
    6857         781 :         USE_OPLINE
    6858             : 
    6859             :         zval *varname;
    6860             :         zval *retval;
    6861             :         zend_string *name;
    6862             :         HashTable *target_symbol_table;
    6863             : 
    6864             :         SAVE_OPLINE();
    6865         781 :         varname = EX_CONSTANT(opline->op1);
    6866             : 
    6867             :         if (IS_CONST == IS_CONST) {
    6868         781 :                 name = Z_STR_P(varname);
    6869             :         } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) {
    6870             :                 name = Z_STR_P(varname);
    6871             :                 zend_string_addref(name);
    6872             :         } else {
    6873             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) {
    6874             :                         GET_OP1_UNDEF_CV(varname, BP_VAR_R);
    6875             :                 }
    6876             :                 name = zval_get_string(varname);
    6877             :         }
    6878             : 
    6879             :         if (IS_VAR != IS_UNUSED) {
    6880             :                 zend_class_entry *ce;
    6881             : 
    6882         781 :                 if (IS_VAR == IS_CONST) {
    6883             :                         if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
    6884             :                                 retval = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
    6885             : 
    6886             :                                 /* check if static properties were destoyed */
    6887             :                                 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    6888             :                                         zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
    6889             : 
    6890             :                                         HANDLE_EXCEPTION();
    6891             :                                 }
    6892             : 
    6893             :                                 goto fetch_var_return;
    6894             :                         } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
    6895             :                                 ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    6896             :                                 if (UNEXPECTED(ce == NULL)) {
    6897             :                                         if (IS_CONST != IS_CONST) {
    6898             :                                                 zend_string_release(name);
    6899             :                                         }
    6900             : 
    6901             :                                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6902             :                                 }
    6903             :                                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    6904             :                         }
    6905             :                 } else {
    6906         781 :                         ce = Z_CE_P(EX_VAR(opline->op2.var));
    6907        1246 :                         if (IS_CONST == IS_CONST &&
    6908        1246 :                             (retval = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce)) != NULL) {
    6909             : 
    6910             :                                 /* check if static properties were destoyed */
    6911         465 :                                 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    6912           2 :                                         zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
    6913             : 
    6914           2 :                                         HANDLE_EXCEPTION();
    6915             :                                 }
    6916             : 
    6917         463 :                                 goto fetch_var_return;
    6918             :                         }
    6919             :                 }
    6920         316 :                 retval = zend_std_get_static_property(ce, name, 0);
    6921         316 :                 if (UNEXPECTED(EG(exception))) {
    6922             : 
    6923           4 :                         HANDLE_EXCEPTION();
    6924             :                 }
    6925         312 :                 if (IS_CONST == IS_CONST && retval) {
    6926         312 :                         CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
    6927             :                 }
    6928             : 
    6929             :         } else {
    6930             :                 target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    6931             :                 retval = zend_hash_find(target_symbol_table, name);
    6932             :                 if (retval == NULL) {
    6933             :                         switch (type) {
    6934             :                                 case BP_VAR_R:
    6935             :                                 case BP_VAR_UNSET:
    6936             :                                         zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    6937             :                                         /* break missing intentionally */
    6938             :                                 case BP_VAR_IS:
    6939             :                                         retval = &EG(uninitialized_zval);
    6940             :                                         break;
    6941             :                                 case BP_VAR_RW:
    6942             :                                         zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    6943             :                                         /* break missing intentionally */
    6944             :                                 case BP_VAR_W:
    6945             :                                         retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
    6946             :                                         break;
    6947             :                                 EMPTY_SWITCH_DEFAULT_CASE()
    6948             :                         }
    6949             :                 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
    6950             :                 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
    6951             :                         retval = Z_INDIRECT_P(retval);
    6952             :                         if (Z_TYPE_P(retval) == IS_UNDEF) {
    6953             :                                 switch (type) {
    6954             :                                         case BP_VAR_R:
    6955             :                                         case BP_VAR_UNSET:
    6956             :                                                 zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    6957             :                                                 /* break missing intentionally */
    6958             :                                         case BP_VAR_IS:
    6959             :                                                 retval = &EG(uninitialized_zval);
    6960             :                                                 break;
    6961             :                                         case BP_VAR_RW:
    6962             :                                                 zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    6963             :                                                 /* break missing intentionally */
    6964             :                                         case BP_VAR_W:
    6965             :                                                 ZVAL_NULL(retval);
    6966             :                                                 break;
    6967             :                                         EMPTY_SWITCH_DEFAULT_CASE()
    6968             :                                 }
    6969             :                         }
    6970             :                 }
    6971             :                 if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
    6972             :                         if (Z_CONSTANT_P(retval)) {
    6973             :                                 if (UNEXPECTED(zval_update_constant_ex(retval, 1, NULL) != SUCCESS)) {
    6974             : 
    6975             :                                         HANDLE_EXCEPTION();
    6976             :                                 }
    6977             :                         }
    6978             :                 } else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
    6979             : 
    6980             :                 }
    6981             :         }
    6982             : 
    6983         312 :         if (IS_CONST != IS_CONST) {
    6984             :                 zend_string_release(name);
    6985             :         }
    6986             : 
    6987             : fetch_var_return:
    6988             :         ZEND_ASSERT(retval != NULL);
    6989        1340 :         if (type == BP_VAR_R || type == BP_VAR_IS) {
    6990         613 :                 if (/*type == BP_VAR_R &&*/ Z_ISREF_P(retval) && Z_REFCOUNT_P(retval) == 1) {
    6991           1 :                         ZVAL_UNREF(retval);
    6992             :                 }
    6993         565 :                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    6994             :         } else {
    6995         210 :                 ZVAL_INDIRECT(EX_VAR(opline->result.var), retval);
    6996             :         }
    6997         775 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    6998             : }
    6999             : 
    7000         547 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7001             : {
    7002         547 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7003             : }
    7004             : 
    7005         157 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7006             : {
    7007         157 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7008             : }
    7009             : 
    7010          51 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7011             : {
    7012          51 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7013             : }
    7014             : 
    7015           7 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7016             : {
    7017           7 :         USE_OPLINE
    7018             : 
    7019          14 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    7020           0 :                 ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7021             :         } else {
    7022           7 :                 ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7023             :         }
    7024             : }
    7025             : 
    7026           6 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7027             : {
    7028           6 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7029             : }
    7030             : 
    7031          13 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7032             : {
    7033          13 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7034             : }
    7035             : 
    7036           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7037             : {
    7038           0 :         USE_OPLINE
    7039             :         zval tmp, *varname;
    7040             :         HashTable *target_symbol_table;
    7041             : 
    7042             : 
    7043             :         SAVE_OPLINE();
    7044           0 :         if (IS_CONST == IS_CV &&
    7045             :             IS_VAR == IS_UNUSED &&
    7046             :             (opline->extended_value & ZEND_QUICK_SET)) {
    7047             :                 zval *var = EX_VAR(opline->op1.var);
    7048             : 
    7049             :                 if (Z_REFCOUNTED_P(var)) {
    7050             :                         zend_refcounted *garbage = Z_COUNTED_P(var);
    7051             : 
    7052             :                         if (!--GC_REFCOUNT(garbage)) {
    7053             :                                 ZVAL_UNDEF(var);
    7054             :                                 zval_dtor_func_for_ptr(garbage);
    7055             :                         } else {
    7056             :                                 GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
    7057             :                                 ZVAL_UNDEF(var);
    7058             :                         }
    7059             :                 } else {
    7060             :                         ZVAL_UNDEF(var);
    7061             :                 }
    7062             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7063             :         }
    7064             : 
    7065           0 :         varname = EX_CONSTANT(opline->op1);
    7066             : 
    7067           0 :         ZVAL_UNDEF(&tmp);
    7068           0 :         if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
    7069             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) {
    7070             :                         varname = GET_OP1_UNDEF_CV(varname, BP_VAR_R);
    7071             :                 }
    7072             :                 ZVAL_STR(&tmp, zval_get_string(varname));
    7073             :                 varname = &tmp;
    7074             :         }
    7075             : 
    7076             :         if (IS_VAR != IS_UNUSED) {
    7077             :                 zend_class_entry *ce;
    7078             : 
    7079           0 :                 if (IS_VAR == IS_CONST) {
    7080             :                         ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    7081             :                         if (UNEXPECTED(ce == NULL)) {
    7082             :                                 ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    7083             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    7084             :                                         if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    7085             :                                                 zend_string_release(Z_STR(tmp));
    7086             :                                         }
    7087             : 
    7088             :                                         HANDLE_EXCEPTION();
    7089             :                                 }
    7090             :                                 if (UNEXPECTED(ce == NULL)) {
    7091             :                                         zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    7092             :                                         if (IS_CONST != IS_CONST) {
    7093             :                                                 zend_string_release(Z_STR(tmp));
    7094             :                                         }
    7095             :                                         HANDLE_EXCEPTION();
    7096             :                                 }
    7097             :                                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    7098             :                         }
    7099             :                 } else {
    7100           0 :                         ce = Z_CE_P(EX_VAR(opline->op2.var));
    7101             :                 }
    7102           0 :                 zend_std_unset_static_property(ce, Z_STR_P(varname));
    7103             :         } else {
    7104             :                 target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    7105             :                 zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
    7106             :         }
    7107             : 
    7108           0 :         if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    7109             :                 zend_string_release(Z_STR(tmp));
    7110             :         }
    7111             : 
    7112           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7113             : }
    7114             : 
    7115         173 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7116             : {
    7117         173 :         USE_OPLINE
    7118             :         zval *value;
    7119             :         int result;
    7120             : 
    7121         173 :         if (IS_CONST == IS_CV &&
    7122             :             IS_VAR == IS_UNUSED &&
    7123             :             (opline->extended_value & ZEND_QUICK_SET)) {
    7124             :                 value = EX_VAR(opline->op1.var);
    7125             :                 if (opline->extended_value & ZEND_ISSET) {
    7126             :                         result =
    7127             :                                 Z_TYPE_P(value) > IS_NULL &&
    7128             :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    7129             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    7130             :                         SAVE_OPLINE();
    7131             :                         result = !i_zend_is_true(value);
    7132             :                         if (UNEXPECTED(EG(exception))) {
    7133             :                                 HANDLE_EXCEPTION();
    7134             :                         }
    7135             :                 }
    7136             :                 ZEND_VM_SMART_BRANCH(result, 0);
    7137             :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    7138             :                 ZEND_VM_SET_NEXT_OPCODE(opline + 1);
    7139             :                 ZEND_VM_CONTINUE();
    7140             :         } else {
    7141             : 
    7142             :                 zval tmp, *varname;
    7143             : 
    7144             :                 SAVE_OPLINE();
    7145         173 :                 varname = EX_CONSTANT(opline->op1);
    7146         173 :                 ZVAL_UNDEF(&tmp);
    7147         173 :                 if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
    7148             :                         ZVAL_STR(&tmp, zval_get_string(varname));
    7149             :                         varname = &tmp;
    7150             :                 }
    7151             : 
    7152             :                 if (IS_VAR != IS_UNUSED) {
    7153             :                         zend_class_entry *ce;
    7154             : 
    7155         173 :                         if (IS_VAR == IS_CONST) {
    7156             :                                 if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
    7157             :                                         value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
    7158             : 
    7159             :                                         /* check if static properties were destoyed */
    7160             :                                         if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    7161             :                                                 value = NULL;
    7162             :                                         }
    7163             : 
    7164             :                                         goto is_var_return;
    7165             :                                 } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
    7166             :                                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    7167             :                                         if (UNEXPECTED(ce == NULL)) {
    7168             :                                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7169             :                                         }
    7170             :                                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    7171             :                                 }
    7172             :                         } else {
    7173         173 :                                 ce = Z_CE_P(EX_VAR(opline->op2.var));
    7174         231 :                                 if (IS_CONST == IS_CONST &&
    7175         231 :                                     (value = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce)) != NULL) {
    7176             : 
    7177             :                                         /* check if static properties were destoyed */
    7178          58 :                                         if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    7179           1 :                                                 value = NULL;
    7180             :                                         }
    7181             : 
    7182          58 :                                         goto is_var_return;
    7183             :                                 }
    7184             :                         }
    7185             : 
    7186         115 :                         value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
    7187             : 
    7188         115 :                         if (IS_CONST == IS_CONST && value) {
    7189         115 :                                 CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
    7190             :                         }
    7191             :                 } else {
    7192             :                         HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    7193             :                         value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
    7194             :                 }
    7195             : 
    7196         115 :                 if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    7197             :                         zend_string_release(Z_STR(tmp));
    7198             :                 }
    7199             : 
    7200             : is_var_return:
    7201         173 :                 if (opline->extended_value & ZEND_ISSET) {
    7202         402 :                         result = value && Z_TYPE_P(value) > IS_NULL &&
    7203           0 :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    7204             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    7205           0 :                         result = !value || !i_zend_is_true(value);
    7206             :                 }
    7207             : 
    7208         173 :                 ZEND_VM_SMART_BRANCH(result, 1);
    7209         170 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    7210         170 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7211             :         }
    7212             : }
    7213             : 
    7214           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7215             : {
    7216           2 :         USE_OPLINE
    7217             : 
    7218           2 :         zend_generator *generator = zend_get_running_generator(execute_data);
    7219             : 
    7220             :         SAVE_OPLINE();
    7221           2 :         if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
    7222           0 :                 zend_throw_error(NULL, "Cannot yield from finally in a force-closed generator");
    7223           0 :                 zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
    7224             : 
    7225           0 :                 HANDLE_EXCEPTION();
    7226             :         }
    7227             : 
    7228             :         /* Destroy the previously yielded value */
    7229           2 :         zval_ptr_dtor(&generator->value);
    7230             : 
    7231             :         /* Destroy the previously yielded key */
    7232           2 :         zval_ptr_dtor(&generator->key);
    7233             : 
    7234             :         /* Set the new yielded value */
    7235             :         if (IS_CONST != IS_UNUSED) {
    7236             : 
    7237             : 
    7238           2 :                 if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
    7239             :                         /* Constants and temporary variables aren't yieldable by reference,
    7240             :                          * but we still allow them with a notice. */
    7241             :                         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    7242             :                                 zval *value;
    7243             : 
    7244           0 :                                 zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    7245             : 
    7246           0 :                                 value = EX_CONSTANT(opline->op1);
    7247           0 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    7248           0 :                                 if (IS_CONST != IS_CONST) {
    7249             :                                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    7250             :                                                 zval_copy_ctor_func(&generator->value);
    7251             :                                         }
    7252             :                                 }
    7253             :                         } else {
    7254             :                                 zval *value_ptr = NULL;
    7255             : 
    7256             :                                 if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
    7257             :                                         zend_throw_error(NULL, "Cannot yield string offsets by reference");
    7258             :                                         zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
    7259             :                                         HANDLE_EXCEPTION();
    7260             :                                 }
    7261             : 
    7262             :                                 /* If a function call result is yielded and the function did
    7263             :                                  * not return by reference we throw a notice. */
    7264             :                                 if (IS_CONST == IS_VAR &&
    7265             :                                     (value_ptr == &EG(uninitialized_zval) ||
    7266             :                                      (opline->extended_value == ZEND_RETURNS_FUNCTION &&
    7267             :                                       !(Z_VAR_FLAGS_P(value_ptr) & IS_VAR_RET_REF)))) {
    7268             :                                         zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    7269             :                                 } else {
    7270             :                                         ZVAL_MAKE_REF(value_ptr);
    7271             :                                 }
    7272             :                                 ZVAL_COPY(&generator->value, value_ptr);
    7273             : 
    7274             :                         }
    7275             :                 } else {
    7276           2 :                         zval *value = EX_CONSTANT(opline->op1);
    7277             : 
    7278             :                         /* Consts, temporary variables and references need copying */
    7279             :                         if (IS_CONST == IS_CONST) {
    7280           2 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    7281           2 :                                 if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    7282           0 :                                         zval_copy_ctor_func(&generator->value);
    7283             :                                 }
    7284             :                         } else if (IS_CONST == IS_TMP_VAR) {
    7285             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    7286             :             } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) {
    7287             :                                 ZVAL_COPY(&generator->value, Z_REFVAL_P(value));
    7288             : 
    7289             :                         } else {
    7290             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    7291             :                                 if (IS_CONST == IS_CV) {
    7292             :                                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    7293             :                                 }
    7294             :                         }
    7295             :                 }
    7296             :         } else {
    7297             :                 /* If no value was specified yield null */
    7298             :                 ZVAL_NULL(&generator->value);
    7299             :         }
    7300             : 
    7301             :         /* Set the new yielded key */
    7302             :         if (IS_VAR != IS_UNUSED) {
    7303             :                 zend_free_op free_op2;
    7304           4 :                 zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
    7305             : 
    7306             :                 /* Consts, temporary variables and references need copying */
    7307           2 :                 if (IS_VAR == IS_CONST) {
    7308             :                         ZVAL_COPY_VALUE(&generator->key, key);
    7309             :                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->key))) {
    7310             :                                 zval_copy_ctor_func(&generator->key);
    7311             :                         }
    7312           2 :                 } else if (IS_VAR == IS_TMP_VAR) {
    7313             :                         ZVAL_COPY_VALUE(&generator->key, key);
    7314           2 :                 } else if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(key)) {
    7315           0 :                         ZVAL_COPY(&generator->key, Z_REFVAL_P(key));
    7316           0 :                         zval_ptr_dtor_nogc(free_op2);
    7317             :                 } else {
    7318           2 :                         ZVAL_COPY_VALUE(&generator->key, key);
    7319           2 :                         if (IS_VAR == IS_CV) {
    7320             :                                 if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key);
    7321             :                         }
    7322             :                 }
    7323             : 
    7324           5 :                 if (Z_TYPE(generator->key) == IS_LONG
    7325           1 :                     && Z_LVAL(generator->key) > generator->largest_used_integer_key
    7326             :                 ) {
    7327           1 :                         generator->largest_used_integer_key = Z_LVAL(generator->key);
    7328             :                 }
    7329             :         } else {
    7330             :                 /* If no key was specified we use auto-increment keys */
    7331             :                 generator->largest_used_integer_key++;
    7332             :                 ZVAL_LONG(&generator->key, generator->largest_used_integer_key);
    7333             :         }
    7334             : 
    7335           2 :         if (RETURN_VALUE_USED(opline)) {
    7336             :                 /* If the return value of yield is used set the send
    7337             :                  * target and initialize it to NULL */
    7338           0 :                 generator->send_target = EX_VAR(opline->result.var);
    7339           0 :                 ZVAL_NULL(generator->send_target);
    7340             :         } else {
    7341           2 :                 generator->send_target = NULL;
    7342             :         }
    7343             : 
    7344             :         /* We increment to the next op, so we are at the correct position when the
    7345             :          * generator is resumed. */
    7346           2 :         ZEND_VM_INC_OPCODE();
    7347             : 
    7348             :         /* The GOTO VM uses a local opline variable. We need to set the opline
    7349             :          * variable in execute_data so we don't resume at an old position. */
    7350             :         SAVE_OPLINE();
    7351             : 
    7352           2 :         ZEND_VM_RETURN();
    7353             : }
    7354             : 
    7355      104086 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int type ZEND_OPCODE_HANDLER_ARGS_DC)
    7356             : {
    7357      104086 :         USE_OPLINE
    7358             : 
    7359             :         zval *varname;
    7360             :         zval *retval;
    7361             :         zend_string *name;
    7362             :         HashTable *target_symbol_table;
    7363             : 
    7364             :         SAVE_OPLINE();
    7365      104086 :         varname = EX_CONSTANT(opline->op1);
    7366             : 
    7367             :         if (IS_CONST == IS_CONST) {
    7368      104086 :                 name = Z_STR_P(varname);
    7369             :         } else if (EXPECTED(Z_TYPE_P(varname) == IS_STRING)) {
    7370             :                 name = Z_STR_P(varname);
    7371             :                 zend_string_addref(name);
    7372             :         } else {
    7373             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) {
    7374             :                         GET_OP1_UNDEF_CV(varname, BP_VAR_R);
    7375             :                 }
    7376             :                 name = zval_get_string(varname);
    7377             :         }
    7378             : 
    7379      104086 :         if (IS_UNUSED != IS_UNUSED) {
    7380             :                 zend_class_entry *ce;
    7381             : 
    7382             :                 if (IS_UNUSED == IS_CONST) {
    7383             :                         if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
    7384             :                                 retval = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
    7385             : 
    7386             :                                 /* check if static properties were destoyed */
    7387             :                                 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    7388             :                                         zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
    7389             : 
    7390             :                                         HANDLE_EXCEPTION();
    7391             :                                 }
    7392             : 
    7393             :                                 goto fetch_var_return;
    7394             :                         } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
    7395             :                                 ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    7396             :                                 if (UNEXPECTED(ce == NULL)) {
    7397             :                                         if (IS_CONST != IS_CONST) {
    7398             :                                                 zend_string_release(name);
    7399             :                                         }
    7400             : 
    7401             :                                         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7402             :                                 }
    7403             :                                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    7404             :                         }
    7405             :                 } else {
    7406             :                         ce = Z_CE_P(EX_VAR(opline->op2.var));
    7407             :                         if (IS_CONST == IS_CONST &&
    7408             :                             (retval = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce)) != NULL) {
    7409             : 
    7410             :                                 /* check if static properties were destoyed */
    7411             :                                 if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    7412             :                                         zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
    7413             : 
    7414             :                                         HANDLE_EXCEPTION();
    7415             :                                 }
    7416             : 
    7417             :                                 goto fetch_var_return;
    7418             :                         }
    7419             :                 }
    7420             :                 retval = zend_std_get_static_property(ce, name, 0);
    7421             :                 if (UNEXPECTED(EG(exception))) {
    7422             : 
    7423             :                         HANDLE_EXCEPTION();
    7424             :                 }
    7425             :                 if (IS_CONST == IS_CONST && retval) {
    7426             :                         CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
    7427             :                 }
    7428             : 
    7429             :         } else {
    7430      208172 :                 target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    7431      104086 :                 retval = zend_hash_find(target_symbol_table, name);
    7432      104086 :                 if (retval == NULL) {
    7433         788 :                         switch (type) {
    7434             :                                 case BP_VAR_R:
    7435             :                                 case BP_VAR_UNSET:
    7436         783 :                                         zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    7437             :                                         /* break missing intentionally */
    7438             :                                 case BP_VAR_IS:
    7439         783 :                                         retval = &EG(uninitialized_zval);
    7440         783 :                                         break;
    7441             :                                 case BP_VAR_RW:
    7442           0 :                                         zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    7443             :                                         /* break missing intentionally */
    7444             :                                 case BP_VAR_W:
    7445           5 :                                         retval = zend_hash_add_new(target_symbol_table, name, &EG(uninitialized_zval));
    7446             :                                         break;
    7447             :                                 EMPTY_SWITCH_DEFAULT_CASE()
    7448             :                         }
    7449             :                 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
    7450      103298 :                 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
    7451       88382 :                         retval = Z_INDIRECT_P(retval);
    7452       88382 :                         if (Z_TYPE_P(retval) == IS_UNDEF) {
    7453         680 :                                 switch (type) {
    7454             :                                         case BP_VAR_R:
    7455             :                                         case BP_VAR_UNSET:
    7456         679 :                                                 zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    7457             :                                                 /* break missing intentionally */
    7458             :                                         case BP_VAR_IS:
    7459         679 :                                                 retval = &EG(uninitialized_zval);
    7460         679 :                                                 break;
    7461             :                                         case BP_VAR_RW:
    7462           0 :                                                 zend_error(E_NOTICE,"Undefined variable: %s", ZSTR_VAL(name));
    7463             :                                                 /* break missing intentionally */
    7464             :                                         case BP_VAR_W:
    7465           1 :                                                 ZVAL_NULL(retval);
    7466             :                                                 break;
    7467             :                                         EMPTY_SWITCH_DEFAULT_CASE()
    7468             :                                 }
    7469             :                         }
    7470             :                 }
    7471      104086 :                 if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_STATIC) {
    7472        1424 :                         if (Z_CONSTANT_P(retval)) {
    7473           6 :                                 if (UNEXPECTED(zval_update_constant_ex(retval, 1, NULL) != SUCCESS)) {
    7474             : 
    7475           0 :                                         HANDLE_EXCEPTION();
    7476             :                                 }
    7477             :                         }
    7478      102662 :                 } else if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) != ZEND_FETCH_GLOBAL_LOCK) {
    7479             : 
    7480             :                 }
    7481             :         }
    7482             : 
    7483      104086 :         if (IS_CONST != IS_CONST) {
    7484             :                 zend_string_release(name);
    7485             :         }
    7486             : 
    7487             : fetch_var_return:
    7488             :         ZEND_ASSERT(retval != NULL);
    7489      206248 :         if (type == BP_VAR_R || type == BP_VAR_IS) {
    7490      102652 :                 if (/*type == BP_VAR_R &&*/ Z_ISREF_P(retval) && Z_REFCOUNT_P(retval) == 1) {
    7491         168 :                         ZVAL_UNREF(retval);
    7492             :                 }
    7493      102162 :                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    7494             :         } else {
    7495        1924 :                 ZVAL_INDIRECT(EX_VAR(opline->result.var), retval);
    7496             :         }
    7497      104086 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7498             : }
    7499             : 
    7500      102141 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_R_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7501             : {
    7502      102141 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7503             : }
    7504             : 
    7505        1891 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_W_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7506             : {
    7507        1891 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7508             : }
    7509             : 
    7510           5 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_RW_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7511             : {
    7512           5 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_RW ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7513             : }
    7514             : 
    7515           4 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7516             : {
    7517           4 :         USE_OPLINE
    7518             : 
    7519           8 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    7520           0 :                 ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_W ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7521             :         } else {
    7522           4 :                 ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_R ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7523             :         }
    7524             : }
    7525             : 
    7526          28 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7527             : {
    7528          28 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_UNSET ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7529             : }
    7530             : 
    7531          17 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_IS_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7532             : {
    7533          17 :         ZEND_VM_TAIL_CALL(zend_fetch_var_address_helper_SPEC_CONST_UNUSED(BP_VAR_IS ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
    7534             : }
    7535             : 
    7536           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7537             : {
    7538           0 :         USE_OPLINE
    7539             :         zval *container;
    7540             :         zend_free_op free_op1;
    7541             : 
    7542             :         SAVE_OPLINE();
    7543             : 
    7544           0 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    7545             :         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    7546           0 :             zend_throw_error(NULL, "Cannot use temporary expression in write context");
    7547             : 
    7548             : 
    7549           0 :                         HANDLE_EXCEPTION();
    7550             :         }
    7551             :                 container = NULL;
    7552             :                 if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
    7553             :                         zend_throw_error(NULL, "Cannot use string offset as an array");
    7554             : 
    7555             :                         HANDLE_EXCEPTION();
    7556             :                 }
    7557             :                 zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
    7558             :                 if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
    7559             :                         EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var), 1);
    7560             :                 }
    7561             : 
    7562             : 
    7563             :         } else {
    7564             :                 if (IS_UNUSED == IS_UNUSED) {
    7565           0 :                         zend_throw_error(NULL, "Cannot use [] for reading");
    7566             : 
    7567             : 
    7568           0 :                         HANDLE_EXCEPTION();
    7569             :                 }
    7570             :                 container = EX_CONSTANT(opline->op1);
    7571             :                 zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED);
    7572             : 
    7573             : 
    7574             :         }
    7575             :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7576             : }
    7577             : 
    7578           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7579             : {
    7580           2 :         USE_OPLINE
    7581             :         zval *function_name;
    7582             :         zend_class_entry *ce;
    7583             :         zend_object *object;
    7584             :         zend_function *fbc;
    7585             :         zend_execute_data *call;
    7586             : 
    7587             :         SAVE_OPLINE();
    7588             : 
    7589             :         if (IS_CONST == IS_CONST) {
    7590             :                 /* no function found. try a static method in class */
    7591           2 :                 ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    7592           2 :                 if (UNEXPECTED(ce == NULL)) {
    7593           2 :                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT |  ZEND_FETCH_CLASS_EXCEPTION);
    7594           2 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    7595           0 :                                 HANDLE_EXCEPTION();
    7596             :                         }
    7597           2 :                         if (UNEXPECTED(ce == NULL)) {
    7598           0 :                                 zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
    7599           0 :                                 HANDLE_EXCEPTION();
    7600             :                         }
    7601           2 :                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
    7602             :                 }
    7603             :         } else {
    7604             :                 ce = Z_CE_P(EX_VAR(opline->op1.var));
    7605             :         }
    7606             : 
    7607           2 :         if (IS_CONST == IS_CONST &&
    7608             :             IS_UNUSED == IS_CONST &&
    7609             :             EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
    7610             :                 /* nothing to do */
    7611           2 :         } else if (IS_CONST != IS_CONST &&
    7612             :                    IS_UNUSED == IS_CONST &&
    7613             :                    (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce))) {
    7614             :                 /* do nothing */
    7615           2 :         } else if (IS_UNUSED != IS_UNUSED) {
    7616             : 
    7617             : 
    7618             :                 function_name = NULL;
    7619             :                 if (IS_UNUSED != IS_CONST) {
    7620             :                         if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
    7621             :                                 if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    7622             :                                         GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    7623             :                                 }
    7624             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    7625             :                                         HANDLE_EXCEPTION();
    7626             :                                 }
    7627             :                                 zend_throw_error(NULL, "Function name must be a string");
    7628             : 
    7629             :                                 HANDLE_EXCEPTION();
    7630             :                         }
    7631             :                 }
    7632             : 
    7633             :                 if (ce->get_static_method) {
    7634             :                         fbc = ce->get_static_method(ce, Z_STR_P(function_name));
    7635             :                 } else {
    7636             :                         fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
    7637             :                 }
    7638             :                 if (UNEXPECTED(fbc == NULL)) {
    7639             :                         if (EXPECTED(!EG(exception))) {
    7640             :                                 zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name));
    7641             :                         }
    7642             : 
    7643             :                         HANDLE_EXCEPTION();
    7644             :                 }
    7645             :                 if (IS_UNUSED == IS_CONST &&
    7646             :                     EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
    7647             :                     EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE)))) {
    7648             :                         if (IS_CONST == IS_CONST) {
    7649             :                                 CACHE_PTR(Z_CACHE_SLOT_P(function_name), fbc);
    7650             :                         } else {
    7651             :                                 CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), ce, fbc);
    7652             :                         }
    7653             :                 }
    7654             :                 if (IS_UNUSED != IS_CONST) {
    7655             : 
    7656             :                 }
    7657             :         } else {
    7658           2 :                 if (UNEXPECTED(ce->constructor == NULL)) {
    7659           1 :                         zend_throw_error(NULL, "Cannot call constructor");
    7660           1 :                         HANDLE_EXCEPTION();
    7661             :                 }
    7662           1 :                 if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
    7663           0 :                         zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name));
    7664           0 :                         HANDLE_EXCEPTION();
    7665             :                 }
    7666           1 :                 fbc = ce->constructor;
    7667             :         }
    7668             : 
    7669           1 :         object = NULL;
    7670           1 :         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    7671           1 :                 if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
    7672           1 :                         object = Z_OBJ(EX(This));
    7673             :                 }
    7674           1 :                 if (!object) {
    7675           0 :                         if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    7676             :                                 /* Allowed for PHP 4 compatibility. */
    7677           0 :                                 zend_error(
    7678             :                                         E_DEPRECATED,
    7679             :                                         "Non-static method %s::%s() should not be called statically",
    7680           0 :                                         ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    7681           0 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    7682           0 :                                         HANDLE_EXCEPTION();
    7683             :                                 }
    7684             :                         } else {
    7685             :                                 /* An internal function assumes $this is present and won't check that.
    7686             :                                  * So PHP would crash by allowing the call. */
    7687           0 :                                 zend_throw_error(
    7688             :                                         zend_ce_error,
    7689             :                                         "Non-static method %s::%s() cannot be called statically",
    7690           0 :                                         ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    7691           0 :                                 HANDLE_EXCEPTION();
    7692             :                         }
    7693             :                 }
    7694             :         }
    7695             : 
    7696           1 :         if (IS_CONST != IS_CONST) {
    7697             :                 /* previous opcode is ZEND_FETCH_CLASS */
    7698             :                 if (((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT ||
    7699             :                     ((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) {
    7700             :                         ce = EX(called_scope);
    7701             :                 }
    7702             :         }
    7703             : 
    7704           2 :         call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
    7705             :                 fbc, opline->extended_value, ce, object);
    7706           1 :         call->prev_execute_data = EX(call);
    7707           1 :         EX(call) = call;
    7708             : 
    7709           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7710             : }
    7711             : 
    7712           8 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7713             : {
    7714           8 :         USE_OPLINE
    7715             : 
    7716             :         SAVE_OPLINE();
    7717           8 :         if (IS_CONST == IS_UNUSED) {
    7718             :                 zend_verify_missing_return_type(EX(func), CACHE_ADDR(opline->op2.num));
    7719             :         } else {
    7720             : /* prevents "undefined variable opline" errors */
    7721             : #if 0 || (IS_CONST != IS_UNUSED)
    7722             :                 zval *retval_ref, *retval_ptr;
    7723             : 
    7724           8 :                 zend_arg_info *ret_info = EX(func)->common.arg_info - 1;
    7725             : 
    7726           8 :                 retval_ref = retval_ptr = EX_CONSTANT(opline->op1);
    7727             : 
    7728             :                 if (IS_CONST == IS_CONST) {
    7729           8 :                         ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr);
    7730           8 :                         retval_ref = retval_ptr = EX_VAR(opline->result.var);
    7731             :                 } else if (IS_CONST == IS_VAR) {
    7732             :                         if (UNEXPECTED(Z_TYPE_P(retval_ptr) == IS_INDIRECT)) {
    7733             :                                 retval_ptr = Z_INDIRECT_P(retval_ptr);
    7734             :                         }
    7735             :                         ZVAL_DEREF(retval_ptr);
    7736             :                 } else if (IS_CONST == IS_CV) {
    7737             :                         ZVAL_DEREF(retval_ptr);
    7738             :                 }
    7739             : 
    7740          15 :                 if (UNEXPECTED(!ret_info->class_name
    7741             :                         && ret_info->type_hint != IS_CALLABLE
    7742             :                         && !ZEND_SAME_FAKE_TYPE(ret_info->type_hint, Z_TYPE_P(retval_ptr))
    7743             :                         && !(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)
    7744             :                         && retval_ref != retval_ptr)
    7745             :                 ) {
    7746             :                         /* A cast might happen - unwrap the reference if this is a by-value return */
    7747           0 :                         if (Z_REFCOUNT_P(retval_ref) == 1) {
    7748           0 :                                 ZVAL_UNREF(retval_ref);
    7749             :                         } else {
    7750             :                                 Z_DELREF_P(retval_ref);
    7751           0 :                                 ZVAL_COPY(retval_ref, retval_ptr);
    7752             :                         }
    7753           0 :                         retval_ptr = retval_ref;
    7754             :                 }
    7755           8 :                 zend_verify_return_type(EX(func), retval_ptr, CACHE_ADDR(opline->op2.num));
    7756             : 
    7757           8 :                 if (UNEXPECTED(EG(exception) != NULL)) {
    7758             : 
    7759             :                 }
    7760             : #endif
    7761             :         }
    7762           8 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7763             : }
    7764             : 
    7765       13710 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7766             : {
    7767       13710 :         USE_OPLINE
    7768             : 
    7769             :         zval *expr_ptr, new_expr;
    7770             : 
    7771             :         SAVE_OPLINE();
    7772       13710 :         if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
    7773             :             UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
    7774             :                 expr_ptr = NULL;
    7775             :                 if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
    7776             :                         zend_throw_error(NULL, "Cannot create references to/from string offsets");
    7777             :                         zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var)));
    7778             :                         HANDLE_EXCEPTION();
    7779             :                 }
    7780             :                 ZVAL_MAKE_REF(expr_ptr);
    7781             :                 Z_ADDREF_P(expr_ptr);
    7782             : 
    7783             :         } else {
    7784       13710 :                 expr_ptr = EX_CONSTANT(opline->op1);
    7785       13710 :                 if (IS_CONST == IS_TMP_VAR) {
    7786             :                         /* pass */
    7787             :                 } else if (IS_CONST == IS_CONST) {
    7788       13710 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(expr_ptr))) {
    7789        1975 :                                 ZVAL_COPY_VALUE(&new_expr, expr_ptr);
    7790        1975 :                                 zval_copy_ctor_func(&new_expr);
    7791        1975 :                                 expr_ptr = &new_expr;
    7792             :                         }
    7793             :                 } else if (IS_CONST == IS_CV) {
    7794             :                         ZVAL_DEREF(expr_ptr);
    7795             :                         if (Z_REFCOUNTED_P(expr_ptr)) {
    7796             :                                 Z_ADDREF_P(expr_ptr);
    7797             :                         }
    7798             :                 } else /* if (IS_CONST == IS_VAR) */ {
    7799             :                         if (UNEXPECTED(Z_ISREF_P(expr_ptr))) {
    7800             :                                 zend_refcounted *ref = Z_COUNTED_P(expr_ptr);
    7801             : 
    7802             :                                 expr_ptr = Z_REFVAL_P(expr_ptr);
    7803             :                                 if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
    7804             :                                         ZVAL_COPY_VALUE(&new_expr, expr_ptr);
    7805             :                                         expr_ptr = &new_expr;
    7806             :                                         efree_size(ref, sizeof(zend_reference));
    7807             :                                 } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) {
    7808             :                                         Z_ADDREF_P(expr_ptr);
    7809             :                                 }
    7810             :                         }
    7811             :                 }
    7812             :         }
    7813             : 
    7814       13710 :         if (IS_UNUSED != IS_UNUSED) {
    7815             : 
    7816             :                 zval *offset = NULL;
    7817             :                 zend_string *str;
    7818             :                 zend_ulong hval;
    7819             : 
    7820             : add_again:
    7821             :                 if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) {
    7822             :                         str = Z_STR_P(offset);
    7823             :                         if (IS_UNUSED != IS_CONST) {
    7824             :                                 if (ZEND_HANDLE_NUMERIC(str, hval)) {
    7825             :                                         goto num_index;
    7826             :                                 }
    7827             :                         }
    7828             : str_index:
    7829             :                         zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
    7830             :                 } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) {
    7831             :                         hval = Z_LVAL_P(offset);
    7832             : num_index:
    7833             :                         zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
    7834             :                 } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && EXPECTED(Z_TYPE_P(offset) == IS_REFERENCE)) {
    7835             :                         offset = Z_REFVAL_P(offset);
    7836             :                         goto add_again;
    7837             :                 } else if (Z_TYPE_P(offset) == IS_NULL) {
    7838             :                         str = ZSTR_EMPTY_ALLOC();
    7839             :                         goto str_index;
    7840             :                 } else if (Z_TYPE_P(offset) == IS_DOUBLE) {
    7841             :                         hval = zend_dval_to_lval(Z_DVAL_P(offset));
    7842             :                         goto num_index;
    7843             :                 } else if (Z_TYPE_P(offset) == IS_FALSE) {
    7844             :                         hval = 0;
    7845             :                         goto num_index;
    7846             :                 } else if (Z_TYPE_P(offset) == IS_TRUE) {
    7847             :                         hval = 1;
    7848             :                         goto num_index;
    7849             :                 } else if (IS_UNUSED == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) {
    7850             :                         GET_OP2_UNDEF_CV(offset, BP_VAR_R);
    7851             :                         str = ZSTR_EMPTY_ALLOC();
    7852             :                         goto str_index;
    7853             :                 } else {
    7854             :                         zend_error(E_WARNING, "Illegal offset type");
    7855             :                         zval_ptr_dtor(expr_ptr);
    7856             :                 }
    7857             : 
    7858             :         } else {
    7859       13710 :                 zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
    7860             :         }
    7861       13710 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7862             : }
    7863             : 
    7864        1174 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7865             : {
    7866             :         zval *array;
    7867             :         uint32_t size;
    7868        1174 :         USE_OPLINE
    7869             : 
    7870        1174 :         array = EX_VAR(opline->result.var);
    7871             :         if (IS_CONST != IS_UNUSED) {
    7872        1174 :                 size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
    7873             :         } else {
    7874             :                 size = 0;
    7875             :         }
    7876        1174 :         ZVAL_NEW_ARR(array);
    7877        1174 :         zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
    7878             : 
    7879             :         if (IS_CONST != IS_UNUSED) {
    7880             :                 /* Explicitly initialize array as not-packed if flag is set */
    7881        1174 :                 if (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
    7882          12 :                         zend_hash_real_init(Z_ARRVAL_P(array), 0);
    7883             :                 }
    7884             :         }
    7885             : 
    7886        1174 :         if (IS_CONST == IS_UNUSED) {
    7887             :                 ZEND_VM_NEXT_OPCODE();
    7888             : #if 0 || (IS_CONST != IS_UNUSED)
    7889             :         } else {
    7890        1174 :                 ZEND_VM_TAIL_CALL(ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    7891             : #endif
    7892             :         }
    7893             : }
    7894             : 
    7895           5 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7896             : {
    7897           5 :         USE_OPLINE
    7898             :         zval tmp, *varname;
    7899             :         HashTable *target_symbol_table;
    7900             : 
    7901             : 
    7902             :         SAVE_OPLINE();
    7903           5 :         if (IS_CONST == IS_CV &&
    7904             :             IS_UNUSED == IS_UNUSED &&
    7905             :             (opline->extended_value & ZEND_QUICK_SET)) {
    7906             :                 zval *var = EX_VAR(opline->op1.var);
    7907             : 
    7908             :                 if (Z_REFCOUNTED_P(var)) {
    7909             :                         zend_refcounted *garbage = Z_COUNTED_P(var);
    7910             : 
    7911             :                         if (!--GC_REFCOUNT(garbage)) {
    7912             :                                 ZVAL_UNDEF(var);
    7913             :                                 zval_dtor_func_for_ptr(garbage);
    7914             :                         } else {
    7915             :                                 GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
    7916             :                                 ZVAL_UNDEF(var);
    7917             :                         }
    7918             :                 } else {
    7919             :                         ZVAL_UNDEF(var);
    7920             :                 }
    7921             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7922             :         }
    7923             : 
    7924           5 :         varname = EX_CONSTANT(opline->op1);
    7925             : 
    7926           5 :         ZVAL_UNDEF(&tmp);
    7927           5 :         if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
    7928             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(varname) == IS_UNDEF)) {
    7929             :                         varname = GET_OP1_UNDEF_CV(varname, BP_VAR_R);
    7930             :                 }
    7931             :                 ZVAL_STR(&tmp, zval_get_string(varname));
    7932             :                 varname = &tmp;
    7933             :         }
    7934             : 
    7935           5 :         if (IS_UNUSED != IS_UNUSED) {
    7936             :                 zend_class_entry *ce;
    7937             : 
    7938             :                 if (IS_UNUSED == IS_CONST) {
    7939             :                         ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
    7940             :                         if (UNEXPECTED(ce == NULL)) {
    7941             :                                 ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    7942             :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    7943             :                                         if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    7944             :                                                 zend_string_release(Z_STR(tmp));
    7945             :                                         }
    7946             : 
    7947             :                                         HANDLE_EXCEPTION();
    7948             :                                 }
    7949             :                                 if (UNEXPECTED(ce == NULL)) {
    7950             :                                         zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
    7951             :                                         if (IS_CONST != IS_CONST) {
    7952             :                                                 zend_string_release(Z_STR(tmp));
    7953             :                                         }
    7954             :                                         HANDLE_EXCEPTION();
    7955             :                                 }
    7956             :                                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    7957             :                         }
    7958             :                 } else {
    7959             :                         ce = Z_CE_P(EX_VAR(opline->op2.var));
    7960             :                 }
    7961             :                 zend_std_unset_static_property(ce, Z_STR_P(varname));
    7962             :         } else {
    7963          10 :                 target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    7964           5 :                 zend_hash_del_ind(target_symbol_table, Z_STR_P(varname));
    7965             :         }
    7966             : 
    7967           5 :         if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    7968             :                 zend_string_release(Z_STR(tmp));
    7969             :         }
    7970             : 
    7971           5 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    7972             : }
    7973             : 
    7974          11 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    7975             : {
    7976          11 :         USE_OPLINE
    7977             :         zval *value;
    7978             :         int result;
    7979             : 
    7980          11 :         if (IS_CONST == IS_CV &&
    7981             :             IS_UNUSED == IS_UNUSED &&
    7982             :             (opline->extended_value & ZEND_QUICK_SET)) {
    7983             :                 value = EX_VAR(opline->op1.var);
    7984             :                 if (opline->extended_value & ZEND_ISSET) {
    7985             :                         result =
    7986             :                                 Z_TYPE_P(value) > IS_NULL &&
    7987             :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    7988             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    7989             :                         SAVE_OPLINE();
    7990             :                         result = !i_zend_is_true(value);
    7991             :                         if (UNEXPECTED(EG(exception))) {
    7992             :                                 HANDLE_EXCEPTION();
    7993             :                         }
    7994             :                 }
    7995             :                 ZEND_VM_SMART_BRANCH(result, 0);
    7996             :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    7997             :                 ZEND_VM_SET_NEXT_OPCODE(opline + 1);
    7998             :                 ZEND_VM_CONTINUE();
    7999             :         } else {
    8000             : 
    8001             :                 zval tmp, *varname;
    8002             : 
    8003             :                 SAVE_OPLINE();
    8004          11 :                 varname = EX_CONSTANT(opline->op1);
    8005          11 :                 ZVAL_UNDEF(&tmp);
    8006          11 :                 if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
    8007             :                         ZVAL_STR(&tmp, zval_get_string(varname));
    8008             :                         varname = &tmp;
    8009             :                 }
    8010             : 
    8011          11 :                 if (IS_UNUSED != IS_UNUSED) {
    8012             :                         zend_class_entry *ce;
    8013             : 
    8014             :                         if (IS_UNUSED == IS_CONST) {
    8015             :                                 if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
    8016             :                                         value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
    8017             : 
    8018             :                                         /* check if static properties were destoyed */
    8019             :                                         if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    8020             :                                                 value = NULL;
    8021             :                                         }
    8022             : 
    8023             :                                         goto is_var_return;
    8024             :                                 } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
    8025             :                                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
    8026             :                                         if (UNEXPECTED(ce == NULL)) {
    8027             :                                                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8028             :                                         }
    8029             :                                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
    8030             :                                 }
    8031             :                         } else {
    8032             :                                 ce = Z_CE_P(EX_VAR(opline->op2.var));
    8033             :                                 if (IS_CONST == IS_CONST &&
    8034             :                                     (value = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce)) != NULL) {
    8035             : 
    8036             :                                         /* check if static properties were destoyed */
    8037             :                                         if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
    8038             :                                                 value = NULL;
    8039             :                                         }
    8040             : 
    8041             :                                         goto is_var_return;
    8042             :                                 }
    8043             :                         }
    8044             : 
    8045             :                         value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
    8046             : 
    8047             :                         if (IS_CONST == IS_CONST && value) {
    8048             :                                 CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
    8049             :                         }
    8050             :                 } else {
    8051          22 :                         HashTable *target_symbol_table = zend_get_target_symbol_table(execute_data, opline->extended_value & ZEND_FETCH_TYPE_MASK);
    8052          22 :                         value = zend_hash_find_ind(target_symbol_table, Z_STR_P(varname));
    8053             :                 }
    8054             : 
    8055          11 :                 if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
    8056             :                         zend_string_release(Z_STR(tmp));
    8057             :                 }
    8058             : 
    8059             : is_var_return:
    8060          11 :                 if (opline->extended_value & ZEND_ISSET) {
    8061          23 :                         result = value && Z_TYPE_P(value) > IS_NULL &&
    8062           2 :                             (!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
    8063             :                 } else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
    8064           8 :                         result = !value || !i_zend_is_true(value);
    8065             :                 }
    8066             : 
    8067          11 :                 ZEND_VM_SMART_BRANCH(result, 1);
    8068          10 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8069          10 :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8070             :         }
    8071             : }
    8072             : 
    8073         417 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8074             : {
    8075         417 :         USE_OPLINE
    8076             :         zval *zfunc;
    8077             : 
    8078             :         SAVE_OPLINE();
    8079             : 
    8080         417 :         zfunc = zend_hash_find(EG(function_table), Z_STR_P(EX_CONSTANT(opline->op1)));
    8081             :         ZEND_ASSERT(zfunc != NULL && Z_FUNC_P(zfunc)->type == ZEND_USER_FUNCTION);
    8082             : 
    8083         441 :         if (UNEXPECTED((Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC) ||
    8084             :                                 (EX(func)->common.fn_flags & ZEND_ACC_STATIC))) {
    8085          24 :                 zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc),
    8086             :                         EG(scope), EX(called_scope), NULL);
    8087             :         } else {
    8088         393 :                 zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc),
    8089         393 :                         EG(scope), EX(called_scope), Z_OBJ(EX(This)) ? &EX(This) : NULL);
    8090             :         }
    8091             : 
    8092         417 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8093             : }
    8094             : 
    8095          55 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8096             : {
    8097          55 :         USE_OPLINE
    8098             : 
    8099          55 :         zend_generator *generator = zend_get_running_generator(execute_data);
    8100             : 
    8101             :         SAVE_OPLINE();
    8102          55 :         if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
    8103           0 :                 zend_throw_error(NULL, "Cannot yield from finally in a force-closed generator");
    8104             : 
    8105             : 
    8106           0 :                 HANDLE_EXCEPTION();
    8107             :         }
    8108             : 
    8109             :         /* Destroy the previously yielded value */
    8110          55 :         zval_ptr_dtor(&generator->value);
    8111             : 
    8112             :         /* Destroy the previously yielded key */
    8113          55 :         zval_ptr_dtor(&generator->key);
    8114             : 
    8115             :         /* Set the new yielded value */
    8116             :         if (IS_CONST != IS_UNUSED) {
    8117             : 
    8118             : 
    8119          55 :                 if (UNEXPECTED(EX(func)->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE)) {
    8120             :                         /* Constants and temporary variables aren't yieldable by reference,
    8121             :                          * but we still allow them with a notice. */
    8122             :                         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    8123             :                                 zval *value;
    8124             : 
    8125           1 :                                 zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    8126             : 
    8127           1 :                                 value = EX_CONSTANT(opline->op1);
    8128           1 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    8129           1 :                                 if (IS_CONST != IS_CONST) {
    8130             :                                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    8131             :                                                 zval_copy_ctor_func(&generator->value);
    8132             :                                         }
    8133             :                                 }
    8134             :                         } else {
    8135             :                                 zval *value_ptr = NULL;
    8136             : 
    8137             :                                 if (IS_CONST == IS_VAR && UNEXPECTED(value_ptr == NULL)) {
    8138             :                                         zend_throw_error(NULL, "Cannot yield string offsets by reference");
    8139             : 
    8140             :                                         HANDLE_EXCEPTION();
    8141             :                                 }
    8142             : 
    8143             :                                 /* If a function call result is yielded and the function did
    8144             :                                  * not return by reference we throw a notice. */
    8145             :                                 if (IS_CONST == IS_VAR &&
    8146             :                                     (value_ptr == &EG(uninitialized_zval) ||
    8147             :                                      (opline->extended_value == ZEND_RETURNS_FUNCTION &&
    8148             :                                       !(Z_VAR_FLAGS_P(value_ptr) & IS_VAR_RET_REF)))) {
    8149             :                                         zend_error(E_NOTICE, "Only variable references should be yielded by reference");
    8150             :                                 } else {
    8151             :                                         ZVAL_MAKE_REF(value_ptr);
    8152             :                                 }
    8153             :                                 ZVAL_COPY(&generator->value, value_ptr);
    8154             : 
    8155             :                         }
    8156             :                 } else {
    8157          54 :                         zval *value = EX_CONSTANT(opline->op1);
    8158             : 
    8159             :                         /* Consts, temporary variables and references need copying */
    8160             :                         if (IS_CONST == IS_CONST) {
    8161          54 :                                 ZVAL_COPY_VALUE(&generator->value, value);
    8162          54 :                                 if (UNEXPECTED(Z_OPT_COPYABLE(generator->value))) {
    8163           0 :                                         zval_copy_ctor_func(&generator->value);
    8164             :                                 }
    8165             :                         } else if (IS_CONST == IS_TMP_VAR) {
    8166             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    8167             :             } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(value)) {
    8168             :                                 ZVAL_COPY(&generator->value, Z_REFVAL_P(value));
    8169             : 
    8170             :                         } else {
    8171             :                                 ZVAL_COPY_VALUE(&generator->value, value);
    8172             :                                 if (IS_CONST == IS_CV) {
    8173             :                                         if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
    8174             :                                 }
    8175             :                         }
    8176             :                 }
    8177             :         } else {
    8178             :                 /* If no value was specified yield null */
    8179             :                 ZVAL_NULL(&generator->value);
    8180             :         }
    8181             : 
    8182             :         /* Set the new yielded key */
    8183          55 :         if (IS_UNUSED != IS_UNUSED) {
    8184             : 
    8185             :                 zval *key = NULL;
    8186             : 
    8187             :                 /* Consts, temporary variables and references need copying */
    8188             :                 if (IS_UNUSED == IS_CONST) {
    8189             :                         ZVAL_COPY_VALUE(&generator->key, key);
    8190             :                         if (UNEXPECTED(Z_OPT_COPYABLE(generator->key))) {
    8191             :                                 zval_copy_ctor_func(&generator->key);
    8192             :                         }
    8193             :                 } else if (IS_UNUSED == IS_TMP_VAR) {
    8194             :                         ZVAL_COPY_VALUE(&generator->key, key);
    8195             :                 } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(key)) {
    8196             :                         ZVAL_COPY(&generator->key, Z_REFVAL_P(key));
    8197             : 
    8198             :                 } else {
    8199             :                         ZVAL_COPY_VALUE(&generator->key, key);
    8200             :                         if (IS_UNUSED == IS_CV) {
    8201             :                                 if (Z_OPT_REFCOUNTED_P(key)) Z_ADDREF_P(key);
    8202             :                         }
    8203             :                 }
    8204             : 
    8205             :                 if (Z_TYPE(generator->key) == IS_LONG
    8206             :                     && Z_LVAL(generator->key) > generator->largest_used_integer_key
    8207             :                 ) {
    8208             :                         generator->largest_used_integer_key = Z_LVAL(generator->key);
    8209             :                 }
    8210             :         } else {
    8211             :                 /* If no key was specified we use auto-increment keys */
    8212          55 :                 generator->largest_used_integer_key++;
    8213          55 :                 ZVAL_LONG(&generator->key, generator->largest_used_integer_key);
    8214             :         }
    8215             : 
    8216          55 :         if (RETURN_VALUE_USED(opline)) {
    8217             :                 /* If the return value of yield is used set the send
    8218             :                  * target and initialize it to NULL */
    8219           7 :                 generator->send_target = EX_VAR(opline->result.var);
    8220           7 :                 ZVAL_NULL(generator->send_target);
    8221             :         } else {
    8222          48 :                 generator->send_target = NULL;
    8223             :         }
    8224             : 
    8225             :         /* We increment to the next op, so we are at the correct position when the
    8226             :          * generator is resumed. */
    8227          55 :         ZEND_VM_INC_OPCODE();
    8228             : 
    8229             :         /* The GOTO VM uses a local opline variable. We need to set the opline
    8230             :          * variable in execute_data so we don't resume at an old position. */
    8231             :         SAVE_OPLINE();
    8232             : 
    8233          55 :         ZEND_VM_RETURN();
    8234             : }
    8235             : 
    8236          70 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8237             : {
    8238          70 :         USE_OPLINE
    8239             : 
    8240             :         zval *op1, *op2, *result;
    8241             : 
    8242          70 :         op1 = EX_CONSTANT(opline->op1);
    8243         140 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8244          70 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    8245          70 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8246          38 :                         result = EX_VAR(opline->result.var);
    8247             :                         fast_long_add_function(result, op1, op2);
    8248          38 :                         ZEND_VM_NEXT_OPCODE();
    8249          32 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8250          30 :                         result = EX_VAR(opline->result.var);
    8251          30 :                         ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2));
    8252          30 :                         ZEND_VM_NEXT_OPCODE();
    8253             :                 }
    8254           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    8255           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8256           0 :                         result = EX_VAR(opline->result.var);
    8257           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2));
    8258           0 :                         ZEND_VM_NEXT_OPCODE();
    8259           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8260           0 :                         result = EX_VAR(opline->result.var);
    8261           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2)));
    8262           0 :                         ZEND_VM_NEXT_OPCODE();
    8263             :                 }
    8264             :         }
    8265             : 
    8266             :         SAVE_OPLINE();
    8267           2 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    8268             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8269             :         }
    8270           2 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    8271           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8272             :         }
    8273           2 :         add_function(EX_VAR(opline->result.var), op1, op2);
    8274             : 
    8275             : 
    8276           2 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8277             : }
    8278             : 
    8279         116 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8280             : {
    8281         116 :         USE_OPLINE
    8282             : 
    8283             :         zval *op1, *op2, *result;
    8284             : 
    8285         116 :         op1 = EX_CONSTANT(opline->op1);
    8286         232 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8287         116 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    8288         116 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8289          97 :                         result = EX_VAR(opline->result.var);
    8290             :                         fast_long_sub_function(result, op1, op2);
    8291          97 :                         ZEND_VM_NEXT_OPCODE();
    8292          19 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8293           2 :                         result = EX_VAR(opline->result.var);
    8294           2 :                         ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2));
    8295           2 :                         ZEND_VM_NEXT_OPCODE();
    8296             :                 }
    8297           0 :         } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    8298           0 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8299           0 :                         result = EX_VAR(opline->result.var);
    8300           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2));
    8301           0 :                         ZEND_VM_NEXT_OPCODE();
    8302           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8303           0 :                         result = EX_VAR(opline->result.var);
    8304           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2)));
    8305           0 :                         ZEND_VM_NEXT_OPCODE();
    8306             :                 }
    8307             :         }
    8308             : 
    8309             :         SAVE_OPLINE();
    8310          17 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    8311             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8312             :         }
    8313          17 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    8314           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8315             :         }
    8316          17 :         sub_function(EX_VAR(opline->result.var), op1, op2);
    8317             : 
    8318             : 
    8319          17 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8320             : }
    8321             : 
    8322        2116 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8323             : {
    8324        2116 :         USE_OPLINE
    8325             : 
    8326             :         zval *op1, *op2, *result;
    8327             : 
    8328        2116 :         op1 = EX_CONSTANT(opline->op1);
    8329        4232 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8330        2116 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    8331        2109 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8332             :                         zend_long overflow;
    8333             : 
    8334        2108 :                         result = EX_VAR(opline->result.var);
    8335        2108 :                         ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow);
    8336        2108 :                         Z_TYPE_INFO_P(result) = overflow ? IS_DOUBLE : IS_LONG;
    8337        2108 :                         ZEND_VM_NEXT_OPCODE();
    8338           1 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8339           0 :                         result = EX_VAR(opline->result.var);
    8340           0 :                         ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2));
    8341           0 :                         ZEND_VM_NEXT_OPCODE();
    8342             :                 }
    8343           7 :         } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    8344           7 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8345           0 :                         result = EX_VAR(opline->result.var);
    8346           0 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2));
    8347           0 :                         ZEND_VM_NEXT_OPCODE();
    8348           7 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8349           7 :                         result = EX_VAR(opline->result.var);
    8350           7 :                         ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2)));
    8351           7 :                         ZEND_VM_NEXT_OPCODE();
    8352             :                 }
    8353             :         }
    8354             : 
    8355             :         SAVE_OPLINE();
    8356           1 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    8357             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8358             :         }
    8359           1 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    8360           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8361             :         }
    8362           1 :         mul_function(EX_VAR(opline->result.var), op1, op2);
    8363             : 
    8364             : 
    8365           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8366             : }
    8367             : 
    8368           4 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8369             : {
    8370           4 :         USE_OPLINE
    8371             : 
    8372             :         zval *op1, *op2;
    8373             : 
    8374             :         SAVE_OPLINE();
    8375           4 :         op1 = EX_CONSTANT(opline->op1);
    8376           8 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8377           4 :         fast_div_function(EX_VAR(opline->result.var), op1, op2);
    8378             : 
    8379             : 
    8380           4 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8381             : }
    8382             : 
    8383           2 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8384             : {
    8385           2 :         USE_OPLINE
    8386             : 
    8387             :         zval *op1, *op2, *result;
    8388             : 
    8389           2 :         op1 = EX_CONSTANT(opline->op1);
    8390           4 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8391           2 :         if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    8392           2 :                 if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8393           1 :                         result = EX_VAR(opline->result.var);
    8394           1 :                         if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
    8395             :                                 SAVE_OPLINE();
    8396           1 :                                 zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Modulo by zero");
    8397           1 :                                 HANDLE_EXCEPTION();
    8398           0 :                         } else if (UNEXPECTED(Z_LVAL_P(op2) == -1)) {
    8399             :                                 /* Prevent overflow error/crash if op1==ZEND_LONG_MIN */
    8400           0 :                                 ZVAL_LONG(result, 0);
    8401             :                         } else {
    8402           0 :                                 ZVAL_LONG(result, Z_LVAL_P(op1) % Z_LVAL_P(op2));
    8403             :                         }
    8404           0 :                         ZEND_VM_NEXT_OPCODE();
    8405             :                 }
    8406             :         }
    8407             : 
    8408             :         SAVE_OPLINE();
    8409           1 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    8410             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8411             :         }
    8412           1 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    8413           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8414             :         }
    8415           1 :         mod_function(EX_VAR(opline->result.var), op1, op2);
    8416             : 
    8417             : 
    8418           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8419             : }
    8420             : 
    8421         172 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8422             : {
    8423         172 :         USE_OPLINE
    8424             : 
    8425             :         zval *op1, *op2;
    8426             : 
    8427             :         SAVE_OPLINE();
    8428         172 :         op1 = EX_CONSTANT(opline->op1);
    8429         344 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8430         172 :         shift_left_function(EX_VAR(opline->result.var), op1, op2);
    8431             : 
    8432             : 
    8433         172 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8434             : }
    8435             : 
    8436           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8437             : {
    8438           0 :         USE_OPLINE
    8439             : 
    8440             :         zval *op1, *op2;
    8441             : 
    8442             :         SAVE_OPLINE();
    8443           0 :         op1 = EX_CONSTANT(opline->op1);
    8444           0 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8445           0 :         shift_right_function(EX_VAR(opline->result.var), op1, op2);
    8446             : 
    8447             : 
    8448           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8449             : }
    8450             : 
    8451      103146 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8452             : {
    8453      103146 :         USE_OPLINE
    8454             : 
    8455             :         zval *op1, *op2;
    8456             : 
    8457             :         SAVE_OPLINE();
    8458      103146 :         op1 = EX_CONSTANT(opline->op1);
    8459      206292 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8460             : 
    8461             :         do {
    8462      103146 :                 if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
    8463             :                     (IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
    8464       90817 :                         zend_string *op1_str = Z_STR_P(op1);
    8465       90817 :                         zend_string *op2_str = Z_STR_P(op2);
    8466             :                         zend_string *str;
    8467             : 
    8468       90817 :                         if (IS_CONST != IS_CONST) {
    8469             :                                 if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) {
    8470             :                                         ZVAL_STR_COPY(EX_VAR(opline->result.var), op2_str);
    8471             : 
    8472             :                                         break;
    8473             :                                 }
    8474             :                         }
    8475             :                         if (IS_CV != IS_CONST) {
    8476       90817 :                                 if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) {
    8477        3933 :                                         ZVAL_STR_COPY(EX_VAR(opline->result.var), op1_str);
    8478             : 
    8479        3933 :                                         break;
    8480             :                                 }
    8481             :                         }
    8482       86884 :                         if (IS_CONST != IS_CONST && IS_CONST != IS_CV &&
    8483             :                             !ZSTR_IS_INTERNED(op1_str) && GC_REFCOUNT(op1_str) == 1) {
    8484             :                             size_t len = ZSTR_LEN(op1_str);
    8485             : 
    8486             :                                 str = zend_string_realloc(op1_str, len + ZSTR_LEN(op2_str), 0);
    8487             :                                 memcpy(ZSTR_VAL(str) + len, ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
    8488             :                                 ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
    8489             :                                 break;
    8490             :                         } else {
    8491      173768 :                                 str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0);
    8492       86884 :                                 memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str));
    8493       86884 :                                 memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
    8494       86884 :                                 ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
    8495             :                         }
    8496             :                 } else {
    8497       12329 :                         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    8498             :                                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8499             :                         }
    8500       12329 :                         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    8501           0 :                                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8502             :                         }
    8503       12329 :                         concat_function(EX_VAR(opline->result.var), op1, op2);
    8504             :                 }
    8505             : 
    8506             :         } while (0);
    8507             : 
    8508      103146 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8509             : }
    8510             : 
    8511          66 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8512             : {
    8513          66 :         USE_OPLINE
    8514             : 
    8515             :         zval *op1, *op2;
    8516             :         int result;
    8517             : 
    8518             :         SAVE_OPLINE();
    8519          66 :         op1 = EX_CONSTANT(opline->op1);
    8520         132 :         op2 = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var);
    8521          66 :         result = fast_is_identical_function(op1, op2);
    8522             : 
    8523             : 
    8524          66 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
    8525          16 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8526          16 :         if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
    8527             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8528             :         }
    8529          16 :         ZEND_VM_NEXT_OPCODE();
    8530             : }
    8531             : 
    8532         133 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8533             : {
    8534         133 :         USE_OPLINE
    8535             : 
    8536             :         zval *op1, *op2;
    8537             :         int result;
    8538             : 
    8539             :         SAVE_OPLINE();
    8540         133 :         op1 = EX_CONSTANT(opline->op1);
    8541         266 :         op2 = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op2.var);
    8542         133 :         result = fast_is_not_identical_function(op1, op2);
    8543             : 
    8544             : 
    8545         133 :         ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
    8546          10 :         ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8547          10 :         if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
    8548             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8549             :         }
    8550          10 :         ZEND_VM_NEXT_OPCODE();
    8551             : }
    8552             : 
    8553        2800 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8554             : {
    8555        2800 :         USE_OPLINE
    8556             : 
    8557             :         zval *op1, *op2, *result;
    8558             : 
    8559        2800 :         op1 = EX_CONSTANT(opline->op1);
    8560        5600 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8561             :         do {
    8562             :                 int result;
    8563             : 
    8564        2800 :                 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
    8565        2785 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    8566        2785 :                                 result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
    8567           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    8568           0 :                                 result = ((double)Z_LVAL_P(op1) == Z_DVAL_P(op2));
    8569             :                         } else {
    8570           0 :                                 break;
    8571             :                         }
    8572          15 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
    8573           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    8574           0 :                                 result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
    8575           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    8576           0 :                                 result = (Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2)));
    8577             :                         } else {
    8578           0 :                                 break;
    8579             :                         }
    8580          15 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    8581          15 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    8582          13 :                                 if (Z_STR_P(op1) == Z_STR_P(op2)) {
    8583           2 :                                         result = 1;
    8584          21 :                                 } else if (Z_STRVAL_P(op1)[0] > '9' || Z_STRVAL_P(op2)[0] > '9') {
    8585          10 :                                         if (Z_STRLEN_P(op1) != Z_STRLEN_P(op2)) {
    8586           9 :                                                 result = 0;
    8587             :                                         } else {
    8588           1 :                                                 result = (memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) == 0);
    8589             :                                         }
    8590             :                                 } else {
    8591           1 :                                         result = (zendi_smart_strcmp(op1, op2) == 0);
    8592             :                                 }
    8593             : 
    8594             : 
    8595             :                         } else {
    8596           2 :                                 break;
    8597             :                         }
    8598             :                 } else {
    8599           0 :                         break;
    8600             :                 }
    8601        2798 :                 ZEND_VM_SMART_BRANCH(result, 0);
    8602           6 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8603           6 :                 ZEND_VM_NEXT_OPCODE();
    8604             :         } while (0);
    8605             : 
    8606             :         SAVE_OPLINE();
    8607           2 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    8608             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8609             :         }
    8610           2 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    8611           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8612             :         }
    8613           2 :         result = EX_VAR(opline->result.var);
    8614           2 :         compare_function(result, op1, op2);
    8615           2 :         ZVAL_BOOL(result, Z_LVAL_P(result) == 0);
    8616             : 
    8617             : 
    8618           2 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8619             : }
    8620             : 
    8621         138 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8622             : {
    8623         138 :         USE_OPLINE
    8624             : 
    8625             :         zval *op1, *op2, *result;
    8626             : 
    8627         138 :         op1 = EX_CONSTANT(opline->op1);
    8628         276 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8629             :         do {
    8630             :                 int result;
    8631             : 
    8632         138 :                 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
    8633          17 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    8634           1 :                                 result = (Z_LVAL_P(op1) != Z_LVAL_P(op2));
    8635          16 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    8636           0 :                                 result = ((double)Z_LVAL_P(op1) != Z_DVAL_P(op2));
    8637             :                         } else {
    8638          16 :                                 break;
    8639             :                         }
    8640         121 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
    8641           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    8642           0 :                                 result = (Z_DVAL_P(op1) != Z_DVAL_P(op2));
    8643           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    8644           0 :                                 result = (Z_DVAL_P(op1) != ((double)Z_LVAL_P(op2)));
    8645             :                         } else {
    8646           0 :                                 break;
    8647             :                         }
    8648         121 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    8649         121 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    8650         119 :                                 if (Z_STR_P(op1) == Z_STR_P(op2)) {
    8651           0 :                                         result = 0;
    8652         232 :                                 } else if (Z_STRVAL_P(op1)[0] > '9' || Z_STRVAL_P(op2)[0] > '9') {
    8653         113 :                                         if (Z_STRLEN_P(op1) != Z_STRLEN_P(op2)) {
    8654           6 :                                                 result = 1;
    8655             :                                         } else {
    8656         107 :                                                 result = (memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) != 0);
    8657             :                                         }
    8658             :                                 } else {
    8659           6 :                                         result = (zendi_smart_strcmp(op1, op2) != 0);
    8660             :                                 }
    8661             : 
    8662             : 
    8663             :                         } else {
    8664           2 :                                 break;
    8665             :                         }
    8666             :                 } else {
    8667           0 :                         break;
    8668             :                 }
    8669         120 :                 ZEND_VM_SMART_BRANCH(result, 0);
    8670           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8671           0 :                 ZEND_VM_NEXT_OPCODE();
    8672             :         } while (0);
    8673             : 
    8674             :         SAVE_OPLINE();
    8675          18 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    8676             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8677             :         }
    8678          18 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    8679           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8680             :         }
    8681          18 :         result = EX_VAR(opline->result.var);
    8682          18 :         compare_function(result, op1, op2);
    8683          18 :         ZVAL_BOOL(result, Z_LVAL_P(result) != 0);
    8684             : 
    8685             : 
    8686          18 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8687             : }
    8688             : 
    8689      992529 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8690             : {
    8691      992529 :         USE_OPLINE
    8692             : 
    8693             :         zval *op1, *op2, *result;
    8694             : 
    8695      992529 :         op1 = EX_CONSTANT(opline->op1);
    8696     1985058 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8697             :         do {
    8698             :                 int result;
    8699             : 
    8700      992529 :                 if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    8701      992528 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8702      955928 :                                 result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
    8703       36600 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8704         278 :                                 result = ((double)Z_LVAL_P(op1) < Z_DVAL_P(op2));
    8705             :                         } else {
    8706       36322 :                                 break;
    8707             :                         }
    8708           1 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    8709           0 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8710           0 :                                 result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
    8711           0 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8712           0 :                                 result = (Z_DVAL_P(op1) < ((double)Z_LVAL_P(op2)));
    8713             :                         } else {
    8714           0 :                                 break;
    8715             :                         }
    8716             :                 } else {
    8717           1 :                         break;
    8718             :                 }
    8719      956206 :                 ZEND_VM_SMART_BRANCH(result, 0);
    8720       14214 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8721       14214 :                 ZEND_VM_NEXT_OPCODE();
    8722             :         } while (0);
    8723             : 
    8724             :         SAVE_OPLINE();
    8725       36323 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    8726             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8727             :         }
    8728       36323 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    8729           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8730             :         }
    8731       36323 :         result = EX_VAR(opline->result.var);
    8732       36323 :         compare_function(result, op1, op2);
    8733       36323 :         ZVAL_BOOL(result, Z_LVAL_P(result) < 0);
    8734             : 
    8735             : 
    8736       36323 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8737             : }
    8738             : 
    8739      158290 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8740             : {
    8741      158290 :         USE_OPLINE
    8742             : 
    8743             :         zval *op1, *op2, *result;
    8744             : 
    8745      158290 :         op1 = EX_CONSTANT(opline->op1);
    8746      316580 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    8747             :         do {
    8748             :                 int result;
    8749             : 
    8750      158290 :                 if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
    8751      158290 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8752      157837 :                                 result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
    8753         453 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8754         452 :                                 result = ((double)Z_LVAL_P(op1) <= Z_DVAL_P(op2));
    8755             :                         } else {
    8756           1 :                                 break;
    8757             :                         }
    8758           0 :                 } else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
    8759           0 :                         if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
    8760           0 :                                 result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
    8761           0 :                         } else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
    8762           0 :                                 result = (Z_DVAL_P(op1) <= ((double)Z_LVAL_P(op2)));
    8763             :                         } else {
    8764           0 :                                 break;
    8765             :                         }
    8766             :                 } else {
    8767           0 :                         break;
    8768             :                 }
    8769      158289 :                 ZEND_VM_SMART_BRANCH(result, 0);
    8770      134846 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    8771      134846 :                 ZEND_VM_NEXT_OPCODE();
    8772             :         } while (0);
    8773             : 
    8774             :         SAVE_OPLINE();
    8775           1 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
    8776             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    8777             :         }
    8778           1 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
    8779           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    8780             :         }
    8781           1 :         result = EX_VAR(opline->result.var);
    8782           1 :         compare_function(result, op1, op2);
    8783           1 :         ZVAL_BOOL(result, Z_LVAL_P(result) <= 0);
    8784             : 
    8785             : 
    8786           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8787             : }
    8788             : 
    8789           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8790             : {
    8791           0 :         USE_OPLINE
    8792             : 
    8793             :         zval *op1, *op2;
    8794             : 
    8795             :         SAVE_OPLINE();
    8796           0 :         op1 = EX_CONSTANT(opline->op1);
    8797           0 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8798           0 :         compare_function(EX_VAR(opline->result.var), op1, op2);
    8799             : 
    8800             : 
    8801           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8802             : }
    8803             : 
    8804           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8805             : {
    8806           1 :         USE_OPLINE
    8807             : 
    8808             :         zval *op1, *op2;
    8809             : 
    8810             :         SAVE_OPLINE();
    8811           1 :         op1 = EX_CONSTANT(opline->op1);
    8812           2 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8813           1 :         bitwise_or_function(EX_VAR(opline->result.var), op1, op2);
    8814             : 
    8815             : 
    8816           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8817             : }
    8818             : 
    8819           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8820             : {
    8821           1 :         USE_OPLINE
    8822             : 
    8823             :         zval *op1, *op2;
    8824             : 
    8825             :         SAVE_OPLINE();
    8826           1 :         op1 = EX_CONSTANT(opline->op1);
    8827           2 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8828           1 :         bitwise_and_function(EX_VAR(opline->result.var), op1, op2);
    8829             : 
    8830             : 
    8831           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8832             : }
    8833             : 
    8834           1 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8835             : {
    8836           1 :         USE_OPLINE
    8837             : 
    8838             :         zval *op1, *op2;
    8839             : 
    8840             :         SAVE_OPLINE();
    8841           1 :         op1 = EX_CONSTANT(opline->op1);
    8842           2 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8843           1 :         bitwise_xor_function(EX_VAR(opline->result.var), op1, op2);
    8844             : 
    8845             : 
    8846           1 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8847             : }
    8848             : 
    8849           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8850             : {
    8851           0 :         USE_OPLINE
    8852             : 
    8853             :         zval *op1, *op2;
    8854             : 
    8855             :         SAVE_OPLINE();
    8856           0 :         op1 = EX_CONSTANT(opline->op1);
    8857           0 :         op2 = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8858           0 :         boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
    8859             : 
    8860             : 
    8861           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8862             : }
    8863             : 
    8864           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8865             : {
    8866           0 :         USE_OPLINE
    8867             : 
    8868             :         zval *container;
    8869             : 
    8870             :         SAVE_OPLINE();
    8871           0 :         container = EX_CONSTANT(opline->op1);
    8872           0 :         zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
    8873             : 
    8874             : 
    8875           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8876             : }
    8877             : 
    8878           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8879             : {
    8880           0 :         USE_OPLINE
    8881             : 
    8882             :         zval *container;
    8883             : 
    8884             :         SAVE_OPLINE();
    8885           0 :         container = EX_CONSTANT(opline->op1);
    8886           0 :         zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
    8887             : 
    8888             : 
    8889           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8890             : }
    8891             : 
    8892           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8893             : {
    8894           0 :         USE_OPLINE
    8895             :         zval *container;
    8896             :         zend_free_op free_op1;
    8897             : 
    8898             :         SAVE_OPLINE();
    8899             : 
    8900           0 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    8901             :         if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    8902           0 :             zend_throw_error(NULL, "Cannot use temporary expression in write context");
    8903             : 
    8904             : 
    8905           0 :                         HANDLE_EXCEPTION();
    8906             :         }
    8907             :                 container = NULL;
    8908             :                 if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
    8909             :                         zend_throw_error(NULL, "Cannot use string offset as an array");
    8910             : 
    8911             :                         HANDLE_EXCEPTION();
    8912             :                 }
    8913             :                 zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
    8914             :                 if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
    8915             :                         EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var), 1);
    8916             :                 }
    8917             : 
    8918             : 
    8919             :         } else {
    8920           0 :                 if (IS_CV == IS_UNUSED) {
    8921             :                         zend_throw_error(NULL, "Cannot use [] for reading");
    8922             : 
    8923             : 
    8924             :                         HANDLE_EXCEPTION();
    8925             :                 }
    8926           0 :                 container = EX_CONSTANT(opline->op1);
    8927           0 :                 zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var), IS_CV);
    8928             : 
    8929             : 
    8930             :         }
    8931           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    8932             : }
    8933             : 
    8934           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    8935             : {
    8936           0 :         USE_OPLINE
    8937             : 
    8938             :         zval *container;
    8939             : 
    8940             :         zval *offset;
    8941             : 
    8942             :         SAVE_OPLINE();
    8943           0 :         container = EX_CONSTANT(opline->op1);
    8944             : 
    8945           0 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    8946             :                 zend_throw_error(NULL, "Using $this when not in object context");
    8947             : 
    8948             :                 HANDLE_EXCEPTION();
    8949             :         }
    8950             : 
    8951           0 :         offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    8952             : 
    8953             :         if (IS_CONST == IS_CONST ||
    8954             :             (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
    8955           0 :                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
    8956             :                         container = Z_REFVAL_P(container);
    8957             :                         if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
    8958             :                                 goto fetch_obj_r_no_object;
    8959             :                         }
    8960             :                 } else {
    8961           0 :                         goto fetch_obj_r_no_object;
    8962             :                 }
    8963             :         }
    8964             : 
    8965             :         /* here we are sure we are dealing with an object */
    8966             :         do {
    8967             :                 zend_object *zobj = Z_OBJ_P(container);
    8968             :                 zval *retval;
    8969             : 
    8970             :                 if (IS_CV == IS_CONST &&
    8971             :                         EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
    8972             :                         uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
    8973             : 
    8974             :                         if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
    8975             :                                 retval = OBJ_PROP(zobj, prop_offset);
    8976             :                                 if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
    8977             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    8978             :                                         break;
    8979             :                                 }
    8980             :                         } else if (EXPECTED(zobj->properties != NULL)) {
    8981             :                                 retval = zend_hash_find(zobj->properties, Z_STR_P(offset));
    8982             :                                 if (EXPECTED(retval)) {
    8983             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    8984             :                                         break;
    8985             :                                 }
    8986             :                         }
    8987             :                 }
    8988             : 
    8989             :                 if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
    8990             : fetch_obj_r_no_object:
    8991           0 :                         zend_error(E_NOTICE, "Trying to get property of non-object");
    8992           0 :                         ZVAL_NULL(EX_VAR(opline->result.var));
    8993             :                 } else {
    8994             :                         retval = zobj->handlers->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
    8995             : 
    8996             :                         if (retval != EX_VAR(opline->result.var)) {
    8997             :                                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    8998             :                         }
    8999             :                 }
    9000             :         } while (0);
    9001             : 
    9002             : 
    9003           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9004             : }
    9005             : 
    9006           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9007             : {
    9008           0 :         USE_OPLINE
    9009             : 
    9010             :         zval *container;
    9011             : 
    9012             :         zval *offset;
    9013             : 
    9014             :         SAVE_OPLINE();
    9015           0 :         container = EX_CONSTANT(opline->op1);
    9016             : 
    9017           0 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    9018             :                 zend_throw_error(NULL, "Using $this when not in object context");
    9019             : 
    9020             :                 HANDLE_EXCEPTION();
    9021             :         }
    9022             : 
    9023           0 :         offset  = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    9024             : 
    9025             :         if (IS_CONST == IS_CONST ||
    9026             :             (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
    9027           0 :                 if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
    9028             :                         container = Z_REFVAL_P(container);
    9029             :                         if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
    9030             :                                 goto fetch_obj_is_no_object;
    9031             :                         }
    9032             :                 } else {
    9033           0 :                         goto fetch_obj_is_no_object;
    9034             :                 }
    9035             :         }
    9036             : 
    9037             :         /* here we are sure we are dealing with an object */
    9038             :         do {
    9039             :                 zend_object *zobj = Z_OBJ_P(container);
    9040             :                 zval *retval;
    9041             : 
    9042             :                 if (IS_CV == IS_CONST &&
    9043             :                         EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
    9044             :                         uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
    9045             : 
    9046             :                         if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
    9047             :                                 retval = OBJ_PROP(zobj, prop_offset);
    9048             :                                 if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
    9049             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    9050             :                                         break;
    9051             :                                 }
    9052             :                         } else if (EXPECTED(zobj->properties != NULL)) {
    9053             :                                 retval = zend_hash_find(zobj->properties, Z_STR_P(offset));
    9054             :                                 if (EXPECTED(retval)) {
    9055             :                                         ZVAL_COPY(EX_VAR(opline->result.var), retval);
    9056             :                                         break;
    9057             :                                 }
    9058             :                         }
    9059             :                 }
    9060             : 
    9061             :                 if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
    9062             : fetch_obj_is_no_object:
    9063           0 :                         ZVAL_NULL(EX_VAR(opline->result.var));
    9064             :                 } else {
    9065             : 
    9066             :                         retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
    9067             : 
    9068             :                         if (retval != EX_VAR(opline->result.var)) {
    9069             :                                 ZVAL_COPY(EX_VAR(opline->result.var), retval);
    9070             :                         }
    9071             :                 }
    9072             :         } while (0);
    9073             : 
    9074             : 
    9075           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9076             : }
    9077             : 
    9078           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9079             : {
    9080           0 :         USE_OPLINE
    9081             :         zval *container;
    9082             : 
    9083           0 :         if (zend_is_by_ref_func_arg_fetch(opline, EX(call))) {
    9084             :                 /* Behave like FETCH_OBJ_W */
    9085             :                 zend_free_op free_op1;
    9086             :                 zval *property;
    9087             : 
    9088             :                 SAVE_OPLINE();
    9089           0 :                 property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    9090           0 :                 container = NULL;
    9091             : 
    9092           0 :                 if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) {
    9093             :                         zend_throw_error(NULL, "Using $this when not in object context");
    9094             : 
    9095             :                         HANDLE_EXCEPTION();
    9096             :                 }
    9097             :                 if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
    9098           0 :                         zend_throw_error(NULL, "Cannot use temporary expression in write context");
    9099             : 
    9100             : 
    9101           0 :                         HANDLE_EXCEPTION();
    9102             :                 }
    9103             :                 if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
    9104             :                         zend_throw_error(NULL, "Cannot use string offset as an object");
    9105             : 
    9106             :                         HANDLE_EXCEPTION();
    9107             :                 }
    9108             :                 zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
    9109             : 
    9110             :                 if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
    9111             :                         EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var), 0);
    9112             :                 }
    9113             : 
    9114             :                 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9115             :         } else {
    9116           0 :                 ZEND_VM_TAIL_CALL(ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
    9117             :         }
    9118             : }
    9119             : 
    9120        8998 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9121             : {
    9122        8998 :         USE_OPLINE
    9123             : 
    9124             :         zval *op1, *op2;
    9125             :         zend_string *op1_str, *op2_str, *str;
    9126             : 
    9127             :         SAVE_OPLINE();
    9128        8998 :         op1 = EX_CONSTANT(opline->op1);
    9129             :         if (IS_CONST == IS_CONST) {
    9130        8998 :                 op1_str = Z_STR_P(op1);
    9131             :         } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    9132             :                 op1_str = zend_string_copy(Z_STR_P(op1));
    9133             :         } else {
    9134             :                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    9135             :                         GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    9136             :                 }
    9137             :                 op1_str = _zval_get_string_func(op1);
    9138             :         }
    9139       17996 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    9140        8998 :         if (IS_CV == IS_CONST) {
    9141             :                 op2_str = Z_STR_P(op2);
    9142        8998 :         } else if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    9143       10226 :                 op2_str = zend_string_copy(Z_STR_P(op2));
    9144             :         } else {
    9145        3885 :                 if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    9146           0 :                         GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    9147             :                 }
    9148        3885 :                 op2_str = _zval_get_string_func(op2);
    9149             :         }
    9150             :         do {
    9151        8998 :                 if (IS_CONST != IS_CONST) {
    9152             :                         if (UNEXPECTED(ZSTR_LEN(op1_str) == 0)) {
    9153             :                                 if (IS_CV == IS_CONST) {
    9154             :                                         zend_string_addref(op2_str);
    9155             :                                 }
    9156             :                                 ZVAL_STR(EX_VAR(opline->result.var), op2_str);
    9157             :                                 zend_string_release(op1_str);
    9158             :                                 break;
    9159             :                         }
    9160             :                 }
    9161             :                 if (IS_CV != IS_CONST) {
    9162        8998 :                         if (UNEXPECTED(ZSTR_LEN(op2_str) == 0)) {
    9163             :                                 if (IS_CONST == IS_CONST) {
    9164             :                                         zend_string_addref(op1_str);
    9165             :                                 }
    9166         231 :                                 ZVAL_STR(EX_VAR(opline->result.var), op1_str);
    9167             :                                 zend_string_release(op2_str);
    9168         231 :                                 break;
    9169             :                         }
    9170             :                 }
    9171       17534 :                 str = zend_string_alloc(ZSTR_LEN(op1_str) + ZSTR_LEN(op2_str), 0);
    9172        8767 :                 memcpy(ZSTR_VAL(str), ZSTR_VAL(op1_str), ZSTR_LEN(op1_str));
    9173        8767 :                 memcpy(ZSTR_VAL(str) + ZSTR_LEN(op1_str), ZSTR_VAL(op2_str), ZSTR_LEN(op2_str)+1);
    9174        8767 :                 ZVAL_NEW_STR(EX_VAR(opline->result.var), str);
    9175        8767 :                 if (IS_CONST != IS_CONST) {
    9176             :                         zend_string_release(op1_str);
    9177             :                 }
    9178             :                 if (IS_CV != IS_CONST) {
    9179             :                         zend_string_release(op2_str);
    9180             :                 }
    9181             :         } while (0);
    9182             : 
    9183             : 
    9184        8998 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9185             : }
    9186             : 
    9187           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9188             : {
    9189           0 :         USE_OPLINE
    9190             :         zval *function_name;
    9191             : 
    9192             :         zval *object;
    9193             :         zend_function *fbc;
    9194             :         zend_class_entry *called_scope;
    9195             :         zend_object *obj;
    9196             :         zend_execute_data *call;
    9197             :         uint32_t call_info;
    9198             : 
    9199             :         SAVE_OPLINE();
    9200             : 
    9201           0 :         function_name = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    9202             : 
    9203           0 :         if (IS_CV != IS_CONST &&
    9204             :             UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
    9205             :                 do {
    9206           0 :                         if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(function_name)) {
    9207           0 :                                 function_name = Z_REFVAL_P(function_name);
    9208           0 :                                 if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
    9209           0 :                                         break;
    9210             :                                 }
    9211             :                         }
    9212           0 :                         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    9213           0 :                                 GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    9214             :                         }
    9215           0 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    9216           0 :                                 HANDLE_EXCEPTION();
    9217             :                         }
    9218           0 :                         zend_throw_error(NULL, "Method name must be a string");
    9219             : 
    9220             : 
    9221           0 :                         HANDLE_EXCEPTION();
    9222             :                 } while (0);
    9223             :         }
    9224             : 
    9225           0 :         object = EX_CONSTANT(opline->op1);
    9226             : 
    9227           0 :         if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) {
    9228             :                 zend_throw_error(NULL, "Using $this when not in object context");
    9229             : 
    9230             :                 HANDLE_EXCEPTION();
    9231             :         }
    9232             : 
    9233             :         if (IS_CONST != IS_UNUSED) {
    9234             :                 do {
    9235             :                         if (IS_CONST == IS_CONST || UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
    9236           0 :                                 if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(object))) {
    9237             :                                         object = Z_REFVAL_P(object);
    9238             :                                         if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) {
    9239             :                                                 break;
    9240             :                                         }
    9241             :                                 }
    9242           0 :                                 if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
    9243             :                                         GET_OP1_UNDEF_CV(object, BP_VAR_R);
    9244             :                                 }
    9245           0 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    9246           0 :                                         HANDLE_EXCEPTION();
    9247             :                                 }
    9248           0 :                                 zend_throw_error(NULL, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_get_type_by_const(Z_TYPE_P(object)));
    9249             : 
    9250             : 
    9251           0 :                                 HANDLE_EXCEPTION();
    9252             :                         }
    9253             :                 } while (0);
    9254             :         }
    9255             : 
    9256             :         obj = Z_OBJ_P(object);
    9257             :         called_scope = obj->ce;
    9258             : 
    9259             :         if (IS_CV != IS_CONST ||
    9260             :             UNEXPECTED((fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL)) {
    9261             :             zend_object *orig_obj = obj;
    9262             : 
    9263             :                 if (UNEXPECTED(obj->handlers->get_method == NULL)) {
    9264             :                         zend_throw_error(NULL, "Object does not support method calls");
    9265             : 
    9266             : 
    9267             :                         HANDLE_EXCEPTION();
    9268             :                 }
    9269             : 
    9270             :                 /* First, locate the function. */
    9271             :                 fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
    9272             :                 if (UNEXPECTED(fbc == NULL)) {
    9273             :                         if (EXPECTED(!EG(exception))) {
    9274             :                                 zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
    9275             :                         }
    9276             : 
    9277             : 
    9278             :                         HANDLE_EXCEPTION();
    9279             :                 }
    9280             :                 if (IS_CV == IS_CONST &&
    9281             :                     EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
    9282             :                     EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE))) &&
    9283             :                     EXPECTED(obj == orig_obj)) {
    9284             :                         CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope, fbc);
    9285             :                 }
    9286             :         }
    9287             : 
    9288             :         call_info = ZEND_CALL_NESTED_FUNCTION;
    9289             :         if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_STATIC) != 0)) {
    9290             :                 obj = NULL;
    9291             :         } else if (IS_CONST & (IS_VAR|IS_TMP_VAR|IS_CV)) {
    9292             :                 /* CV may be changed indirectly (e.g. when it's a reference) */
    9293             :                 call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_RELEASE_THIS;
    9294             :                 GC_REFCOUNT(obj)++; /* For $this pointer */
    9295             :         }
    9296             : 
    9297             :         call = zend_vm_stack_push_call_frame(call_info,
    9298             :                 fbc, opline->extended_value, called_scope, obj);
    9299             :         call->prev_execute_data = EX(call);
    9300             :         EX(call) = call;
    9301             : 
    9302             : 
    9303             :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9304             : }
    9305             : 
    9306          82 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9307             : {
    9308          82 :         USE_OPLINE
    9309             :         zval *function_name;
    9310             :         zend_class_entry *ce;
    9311             :         zend_object *object;
    9312             :         zend_function *fbc;
    9313             :         zend_execute_data *call;
    9314             : 
    9315             :         SAVE_OPLINE();
    9316             : 
    9317             :         if (IS_CONST == IS_CONST) {
    9318             :                 /* no function found. try a static method in class */
    9319          82 :                 ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    9320          82 :                 if (UNEXPECTED(ce == NULL)) {
    9321           9 :                         ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT |  ZEND_FETCH_CLASS_EXCEPTION);
    9322           9 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    9323           0 :                                 HANDLE_EXCEPTION();
    9324             :                         }
    9325           9 :                         if (UNEXPECTED(ce == NULL)) {
    9326           0 :                                 zend_throw_error(NULL, "Class '%s' not found", Z_STRVAL_P(EX_CONSTANT(opline->op1)));
    9327           0 :                                 HANDLE_EXCEPTION();
    9328             :                         }
    9329           9 :                         CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
    9330             :                 }
    9331             :         } else {
    9332             :                 ce = Z_CE_P(EX_VAR(opline->op1.var));
    9333             :         }
    9334             : 
    9335          82 :         if (IS_CONST == IS_CONST &&
    9336             :             IS_CV == IS_CONST &&
    9337             :             EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
    9338             :                 /* nothing to do */
    9339          82 :         } else if (IS_CONST != IS_CONST &&
    9340             :                    IS_CV == IS_CONST &&
    9341             :                    (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce))) {
    9342             :                 /* do nothing */
    9343             :         } else if (IS_CV != IS_UNUSED) {
    9344             : 
    9345             : 
    9346         164 :                 function_name = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    9347             :                 if (IS_CV != IS_CONST) {
    9348          82 :                         if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
    9349           2 :                                 if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(function_name) == IS_UNDEF)) {
    9350           1 :                                         GET_OP2_UNDEF_CV(function_name, BP_VAR_R);
    9351             :                                 }
    9352           2 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    9353           1 :                                         HANDLE_EXCEPTION();
    9354             :                                 }
    9355           1 :                                 zend_throw_error(NULL, "Function name must be a string");
    9356             : 
    9357           1 :                                 HANDLE_EXCEPTION();
    9358             :                         }
    9359             :                 }
    9360             : 
    9361          80 :                 if (ce->get_static_method) {
    9362           0 :                         fbc = ce->get_static_method(ce, Z_STR_P(function_name));
    9363             :                 } else {
    9364          80 :                         fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
    9365             :                 }
    9366          80 :                 if (UNEXPECTED(fbc == NULL)) {
    9367           0 :                         if (EXPECTED(!EG(exception))) {
    9368           0 :                                 zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(ce->name), Z_STRVAL_P(function_name));
    9369             :                         }
    9370             : 
    9371           0 :                         HANDLE_EXCEPTION();
    9372             :                 }
    9373          80 :                 if (IS_CV == IS_CONST &&
    9374             :                     EXPECTED(fbc->type <= ZEND_USER_FUNCTION) &&
    9375             :                     EXPECTED(!(fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE|ZEND_ACC_NEVER_CACHE)))) {
    9376             :                         if (IS_CONST == IS_CONST) {
    9377             :                                 CACHE_PTR(Z_CACHE_SLOT_P(function_name), fbc);
    9378             :                         } else {
    9379             :                                 CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), ce, fbc);
    9380             :                         }
    9381             :                 }
    9382             :                 if (IS_CV != IS_CONST) {
    9383             : 
    9384             :                 }
    9385             :         } else {
    9386             :                 if (UNEXPECTED(ce->constructor == NULL)) {
    9387             :                         zend_throw_error(NULL, "Cannot call constructor");
    9388             :                         HANDLE_EXCEPTION();
    9389             :                 }
    9390             :                 if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
    9391             :                         zend_throw_error(NULL, "Cannot call private %s::__construct()", ZSTR_VAL(ce->name));
    9392             :                         HANDLE_EXCEPTION();
    9393             :                 }
    9394             :                 fbc = ce->constructor;
    9395             :         }
    9396             : 
    9397          80 :         object = NULL;
    9398          80 :         if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
    9399           1 :                 if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
    9400           0 :                         object = Z_OBJ(EX(This));
    9401             :                 }
    9402           1 :                 if (!object) {
    9403           1 :                         if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
    9404             :                                 /* Allowed for PHP 4 compatibility. */
    9405           2 :                                 zend_error(
    9406             :                                         E_DEPRECATED,
    9407             :                                         "Non-static method %s::%s() should not be called statically",
    9408           2 :                                         ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    9409           1 :                                 if (UNEXPECTED(EG(exception) != NULL)) {
    9410           0 :                                         HANDLE_EXCEPTION();
    9411             :                                 }
    9412             :                         } else {
    9413             :                                 /* An internal function assumes $this is present and won't check that.
    9414             :                                  * So PHP would crash by allowing the call. */
    9415           0 :                                 zend_throw_error(
    9416             :                                         zend_ce_error,
    9417             :                                         "Non-static method %s::%s() cannot be called statically",
    9418           0 :                                         ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
    9419           0 :                                 HANDLE_EXCEPTION();
    9420             :                         }
    9421             :                 }
    9422             :         }
    9423             : 
    9424          80 :         if (IS_CONST != IS_CONST) {
    9425             :                 /* previous opcode is ZEND_FETCH_CLASS */
    9426             :                 if (((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT ||
    9427             :                     ((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) {
    9428             :                         ce = EX(called_scope);
    9429             :                 }
    9430             :         }
    9431             : 
    9432         160 :         call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION,
    9433             :                 fbc, opline->extended_value, ce, object);
    9434          80 :         call->prev_execute_data = EX(call);
    9435          80 :         EX(call) = call;
    9436             : 
    9437          80 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9438             : }
    9439             : 
    9440          97 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9441             : {
    9442          97 :         USE_OPLINE
    9443             : 
    9444             :         zval *function_name;
    9445             :         zend_fcall_info_cache fcc;
    9446          97 :         char *error = NULL;
    9447             :         zend_function *func;
    9448             :         zend_class_entry *called_scope;
    9449             :         zend_object *object;
    9450             :         zend_execute_data *call;
    9451          97 :         uint32_t call_info = ZEND_CALL_NESTED_FUNCTION;
    9452             : 
    9453             :         SAVE_OPLINE();
    9454         194 :         function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
    9455          97 :         if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
    9456          71 :                 func = fcc.function_handler;
    9457          71 :                 if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
    9458             :                         /* Delay closure destruction until its invocation */
    9459             :                         if (IS_CV & (IS_VAR|IS_CV)) {
    9460           3 :                                 ZVAL_DEREF(function_name);
    9461             :                         }
    9462             :                         ZEND_ASSERT(GC_TYPE((zend_object*)func->common.prototype) == IS_OBJECT);
    9463           3 :                         GC_REFCOUNT((zend_object*)func->common.prototype)++;
    9464           3 :                         call_info |= ZEND_CALL_CLOSURE;
    9465             :                 }
    9466          71 :                 called_scope = fcc.called_scope;
    9467          71 :                 object = fcc.object;
    9468          71 :                 if (object) {
    9469          19 :                         call_info |= ZEND_CALL_RELEASE_THIS;
    9470          19 :                         GC_REFCOUNT(object)++; /* For $this pointer */
    9471             :                 }
    9472          71 :                 if (error) {
    9473           1 :                         efree(error);
    9474             :                         /* This is the only soft error is_callable() can generate */
    9475           2 :                         zend_error(E_DEPRECATED,
    9476             :                                 "Non-static method %s::%s() should not be called statically",
    9477           2 :                                 ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
    9478           1 :                         if (UNEXPECTED(EG(exception) != NULL)) {
    9479           0 :                                 HANDLE_EXCEPTION();
    9480             :                         }
    9481             :                 }
    9482             :         } else {
    9483          26 :                 zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
    9484          26 :                 efree(error);
    9485          26 :                 func = (zend_function*)&zend_pass_function;
    9486          26 :                 called_scope = NULL;
    9487          26 :                 object = NULL;
    9488             :         }
    9489             : 
    9490         194 :         call = zend_vm_stack_push_call_frame(call_info,
    9491             :                 func, opline->extended_value, called_scope, object);
    9492          97 :         call->prev_execute_data = EX(call);
    9493          97 :         EX(call) = call;
    9494             : 
    9495          97 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9496             : }
    9497             : 
    9498        2034 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9499             : {
    9500        2034 :         USE_OPLINE
    9501             :         zend_class_entry *ce, *catch_ce;
    9502             :         zend_object *exception;
    9503             : 
    9504             :         SAVE_OPLINE();
    9505             :         /* Check whether an exception has been thrown, if not, jump over code */
    9506        2034 :         zend_exception_restore();
    9507        2034 :         if (EG(exception) == NULL) {
    9508           0 :                 ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
    9509           0 :                 ZEND_VM_CONTINUE(); /* CHECK_ME */
    9510             :         }
    9511        2034 :         catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
    9512        2034 :         if (UNEXPECTED(catch_ce == NULL)) {
    9513        1069 :                 catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
    9514             : 
    9515        1069 :                 CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), catch_ce);
    9516             :         }
    9517        2034 :         ce = EG(exception)->ce;
    9518             : 
    9519             : #ifdef HAVE_DTRACE
    9520             :         if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
    9521             :                 DTRACE_EXCEPTION_CAUGHT((char *)ce->name);
    9522             :         }
    9523             : #endif /* HAVE_DTRACE */
    9524             : 
    9525        2034 :         if (ce != catch_ce) {
    9526         887 :                 if (!catch_ce || !instanceof_function(ce, catch_ce)) {
    9527          81 :                         if (opline->result.num) {
    9528          13 :                                 zend_throw_exception_internal(NULL);
    9529          13 :                                 HANDLE_EXCEPTION();
    9530             :                         }
    9531          68 :                         ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
    9532          68 :                         ZEND_VM_CONTINUE(); /* CHECK_ME */
    9533             :                 }
    9534             :         }
    9535             : 
    9536        1953 :         exception = EG(exception);
    9537        1953 :         zval_ptr_dtor(EX_VAR(opline->op2.var));
    9538        1953 :         ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
    9539        1953 :         if (UNEXPECTED(EG(exception) != exception)) {
    9540           1 :                 GC_REFCOUNT(EG(exception))++;
    9541           1 :                 HANDLE_EXCEPTION();
    9542             :         } else {
    9543        1952 :                 EG(exception) = NULL;
    9544        1952 :                 ZEND_VM_NEXT_OPCODE();
    9545             :         }
    9546             : }
    9547             : 
    9548           0 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9549             : {
    9550           0 :         USE_OPLINE
    9551             : 
    9552             :         zval *op1, *op2, *result;
    9553             : 
    9554           0 :         op1 = EX_CONSTANT(opline->op1);
    9555           0 :         op2 = _get_zval_ptr_cv_undef(execute_data, opline->op2.var);
    9556             :         do {
    9557             :                 int result;
    9558             : 
    9559           0 :                 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
    9560           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    9561           0 :                                 result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
    9562           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    9563           0 :                                 result = ((double)Z_LVAL_P(op1) == Z_DVAL_P(op2));
    9564             :                         } else {
    9565           0 :                                 break;
    9566             :                         }
    9567           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
    9568           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
    9569           0 :                                 result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
    9570           0 :                         } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
    9571           0 :                                 result = (Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2)));
    9572             :                         } else {
    9573           0 :                                 break;
    9574             :                         }
    9575           0 :                 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
    9576           0 :                         if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
    9577           0 :                                 if (Z_STR_P(op1) == Z_STR_P(op2)) {
    9578           0 :                                         result = 1;
    9579           0 :                                 } else if (Z_STRVAL_P(op1)[0] > '9' || Z_STRVAL_P(op2)[0] > '9') {
    9580           0 :                                         if (Z_STRLEN_P(op1) != Z_STRLEN_P(op2)) {
    9581           0 :                                                 result = 0;
    9582             :                                         } else {
    9583           0 :                                                 result = (memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) == 0);
    9584             :                                         }
    9585             :                                 } else {
    9586           0 :                                         result = (zendi_smart_strcmp(op1, op2) == 0);
    9587             :                                 }
    9588             : 
    9589             :                         } else {
    9590           0 :                                 break;
    9591             :                         }
    9592             :                 } else {
    9593           0 :                         break;
    9594             :                 }
    9595           0 :                 ZEND_VM_SMART_BRANCH(result, 0);
    9596           0 :                 ZVAL_BOOL(EX_VAR(opline->result.var), result);
    9597           0 :                 ZEND_VM_NEXT_OPCODE();
    9598             :         } while (0);
    9599             : 
    9600             :         SAVE_OPLINE();
    9601           0 :         if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
    9602             :                 op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
    9603             :         }
    9604           0 :         if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
    9605           0 :                 op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
    9606             :         }
    9607           0 :         result = EX_VAR(opline->result.var);
    9608           0 :         compare_function(result, op1, op2);
    9609           0 :         ZVAL_BOOL(result, Z_LVAL_P(result) == 0);
    9610             : 
    9611           0 :         ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
    9612             : }
    9613             : 
    9614          70 : static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
    9615             : {
    9616          70 :         USE_OPLINE
    9617             : 
    9618             :         zval *expr_ptr, new_expr;
    9619             : 
    9620             :         SAVE_OPLINE();
    9621          70 :         if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
    9622             :             UNEXPECTED(opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
    9623             :                 expr_ptr = NULL;
    9624             :                 if (IS_CONST == IS_VAR && UNEXPECTED(expr_ptr == NULL)) {
    9625             :                         zend_throw_error(NULL, "Cannot create references to/from string offsets");
    9626             :                         zend_array_destroy(Z_ARRVAL_P(EX_VAR(opline->result.var)));
    9627             :                         HANDLE_EXCEPTION();
    9628             :                 }
    9629             :                 ZVAL_MAKE_REF(expr_ptr);
    9630             :                 Z_ADDREF_P(expr_ptr);
    9631             : 
    9632             :         } else {
    9633          70 :                 expr_ptr = EX_CONSTANT(opline->op1);
    9634          70 :                 if (IS_CONST == IS_TMP_VAR) {
    9635             :                         /* pass */
    9636             :                 } else if (IS_CONST == IS_CONST) {
    9637          70 :                         if (UNEXPECTED(Z_OPT_COPYABLE_P(expr_ptr))) {
    9638           1 :                                 ZVAL_COPY_VALUE(&new_expr, expr_ptr);
    9639           1 :                                 zval_copy_ctor_func(&new_expr);
    9640           1 :                                 expr_ptr = &new_expr;
    9641             :                         }
    9642             :                 } else if (IS_CONST == IS_CV) {
    9643             :                         ZVAL_DEREF(expr_ptr);
    9644             :                         if (Z_REFCOUNTED_P(expr_ptr)) {
    9645             :                                 Z_ADDREF_P(expr_ptr);
    9646             :                         }
    9647             :                 } else /* if (IS_CONST == IS_VAR) */ {
    9648             :                         if (UNEXPECTED(Z_ISREF_P(expr_ptr))) {
    9649             :                                 zend_refcounted *ref = Z_COUNTED_P(expr_ptr);
    9650             : 
    9651             :                                 expr_ptr = Z_REFVAL_P(expr_ptr);
    9652             :                                 if (UNEXPECTED(--GC_REFCOUNT(ref) == 0)) {
    9653             :                                         ZVAL_COPY_VALUE(&new_expr, expr_ptr);
    9654             :                                         expr_ptr = &new_expr;
    9655             :                                         efree_size(ref, sizeof(zend_reference));
    9656             :                                 } else if (Z_OPT_REFCOUNTED_P(expr_ptr)) {
    9657             :                                         Z_ADDREF_P(expr_ptr);
    9658             :                                 }
    9659             :