3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$foo, $bar) { $bar = explode(',', $bar); foreach ($bar as $baz) { $foo[$baz] = $baz; } } $foo = []; foo($foo, ''); foo($foo, 'foo,bar'); foo($foo, ''); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFlnN
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'foo'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 ''
          4        DO_FCALL                                      0          
   12     5        INIT_FCALL                                               'foo'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'foo%2Cbar'
          8        DO_FCALL                                      0          
   13     9        INIT_FCALL                                               'foo'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 ''
         12        DO_FCALL                                      0          
   15    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/bFlnN
function name:  foo
number of ops:  14
compiled vars:  !0 = $foo, !1 = $bar, !2 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    5     7      > FE_RESET_R                                       $5      !1, ->12
          8    > > FE_FETCH_R                                               $5, !2, ->12
    6     9    >   ASSIGN_DIM                                               !0, !2
         10        OP_DATA                                                  !2
    5    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $5
    8    13      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.8 ms | 1403 KiB | 20 Q