3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$obj) { return $obj; } $o = new StdClass; // No errors foo($o); call_user_func('foo', $o); call_user_func('foo', [$o]); $a[] = $o; $a[] = $o; $a[] = $o; // Warning: Parameter 1 to foo() expected to be a reference, value given in call_user_func('foo', array_slice($a, 0, 1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oBnkT
function name:  (null)
number of ops:  28
compiled vars:  !0 = $o, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        INIT_FCALL                                               'foo'
          4        SEND_REF                                                 !0
          5        DO_FCALL                                      0          
   10     6        INIT_FCALL                                               'foo'
          7        SEND_USER                                                !0
          8        DO_FCALL                                      0          
   11     9        INIT_FCALL                                               'foo'
         10        INIT_ARRAY                                       ~7      !0
         11        SEND_USER                                                ~7
         12        DO_FCALL                                      0          
   14    13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  !0
   15    15        ASSIGN_DIM                                               !1
         16        OP_DATA                                                  !0
   16    17        ASSIGN_DIM                                               !1
         18        OP_DATA                                                  !0
   18    19        INIT_FCALL                                               'foo'
         20        INIT_FCALL                                               'array_slice'
         21        SEND_VAR                                                 !1
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $12     
         25        SEND_USER                                                $12
         26        DO_FCALL                                      0          
         27      > RETURN                                                   1

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

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1448 KiB | 18 Q