3v4l.org

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

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

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.75 ms | 1403 KiB | 21 Q