3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$bar) { $bar = 1; return 1; } $arg = 0; $called = 0; $called=call_user_func_array('foo', array(0)); var_dump(array('arg'=>$arg, 'called'=>$called)); $arg = 0; $called = 0; $called=call_user_func_array('foo', array($arg)); var_dump(array('arg'=>$arg, 'called'=>$called)); $arg = 0; $called = 0; $called=call_user_func_array('foo', array(&$arg)); var_dump(array('arg'=>$arg, 'called'=>$called));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WRkIH
function name:  (null)
number of ops:  39
compiled vars:  !0 = $arg, !1 = $called
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 0
          1        ASSIGN                                                   !1, 0
          2        INIT_FCALL                                               'foo'
          3        SEND_ARRAY                                               <array>
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      0  $4      
          6        ASSIGN                                                   !1, $4
          7        INIT_FCALL                                               'var_dump'
          8        INIT_ARRAY                                       ~6      !0, 'arg'
          9        ADD_ARRAY_ELEMENT                                ~6      !1, 'called'
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
    9    12        ASSIGN                                                   !0, 0
         13        ASSIGN                                                   !1, 0
         14        INIT_FCALL                                               'foo'
         15        INIT_ARRAY                                       ~10     !0
         16        SEND_ARRAY                                               ~10
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !1, $11
         20        INIT_FCALL                                               'var_dump'
         21        INIT_ARRAY                                       ~13     !0, 'arg'
         22        ADD_ARRAY_ELEMENT                                ~13     !1, 'called'
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                                 
   10    25        ASSIGN                                                   !0, 0
         26        ASSIGN                                                   !1, 0
         27        INIT_FCALL                                               'foo'
         28        INIT_ARRAY                                       ~17     !0
         29        SEND_ARRAY                                               ~17
         30        CHECK_UNDEF_ARGS                                         
         31        DO_FCALL                                      0  $18     
         32        ASSIGN                                                   !1, $18
         33        INIT_FCALL                                               'var_dump'
         34        INIT_ARRAY                                       ~20     !0, 'arg'
         35        ADD_ARRAY_ELEMENT                                ~20     !1, 'called'
         36        SEND_VAL                                                 ~20
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

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

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.52 ms | 1407 KiB | 18 Q