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