3v4l.org

run code in 300+ PHP versions simultaneously
<?php function by_ref(&$arg) { $arg = 42; } class ModuleHandler { public function invokeAll($hook, &$args) { by_ref($args[0]); } } $moduleHandler = new ModuleHandler(); $moduleHandler->invokeAll('example', array(23)); $array = array(25); $moduleHandler->invokeAll('example', $array); var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aU4bS
function name:  (null)
number of ops:  16
compiled vars:  !0 = $moduleHandler, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'ModuleHandler'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'invokeAll'
          4        SEND_VAL_EX                                              'example'
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
   16     7        ASSIGN                                                   !1, <array>
   18     8        INIT_METHOD_CALL                                         !0, 'invokeAll'
          9        SEND_VAL_EX                                              'example'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
   20    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function by_ref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aU4bS
function name:  by_ref
number of ops:  3
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !0, 42
    5     2      > RETURN                                                   null

End of function by_ref

Class ModuleHandler:
Function invokeall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aU4bS
function name:  invokeAll
number of ops:  7
compiled vars:  !0 = $hook, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        INIT_FCALL                                               'by_ref'
          3        FETCH_DIM_W                                      $2      !1, 0
          4        SEND_REF                                                 $2
          5        DO_FCALL                                      0          
   10     6      > RETURN                                                   null

End of function invokeall

End of class ModuleHandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
292.92 ms | 1399 KiB | 17 Q