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: 6908 12539 55.1 %
Date: 2014-12-13 Functions: 552 950 58.1 %
Legend: Lines: hit not hit

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