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