3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class Mage { public static function dispatchEvent($args) { $observer = new stdClass(); $observer->data = $args; $vars = $observer->data['vars']; $vars['order'] = '#1000000123'; } } $vars = array(); Mage::dispatchEvent(array('vars' => $vars)); print_r($vars); Mage::dispatchEvent(array('vars' => &$vars)); print_r($vars);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTXs2
function name:  (null)
number of ops:  19
compiled vars:  !0 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   14     3        ASSIGN                                                   !0, <array>
   16     4        INIT_STATIC_METHOD_CALL                                  'Mage', 'dispatchEvent'
          5        INIT_ARRAY                                       ~3      !0, 'vars'
          6        SEND_VAL                                                 ~3
          7        DO_FCALL                                      0          
   17     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   19    11        INIT_STATIC_METHOD_CALL                                  'Mage', 'dispatchEvent'
         12        INIT_ARRAY                                       ~6      !0, 'vars'
         13        SEND_VAL                                                 ~6
         14        DO_FCALL                                      0          
   20    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class Mage:
Function dispatchevent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTXs2
function name:  dispatchEvent
number of ops:  12
compiled vars:  !0 = $args, !1 = $observer, !2 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        NEW                                              $3      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
    8     4        ASSIGN_OBJ                                               !1, 'data'
          5        OP_DATA                                                  !0
    9     6        FETCH_OBJ_R                                      ~7      !1, 'data'
          7        FETCH_DIM_R                                      ~8      ~7, 'vars'
          8        ASSIGN                                                   !2, ~8
   10     9        ASSIGN_DIM                                               !2, 'order'
         10        OP_DATA                                                  '%231000000123'
   11    11      > RETURN                                                   null

End of function dispatchevent

End of class Mage.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.8 ms | 1396 KiB | 17 Q