3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$foo, $bar) { $bar = explode(',', $bar); foreach ($bar as $baz) { if (!array_key_exists($baz, $foo)) { $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/43Gli
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'foo'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 ''
          4        DO_FCALL                                      0          
   14     5        INIT_FCALL                                               'foo'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'foo%2Cbar'
          8        DO_FCALL                                      0          
   15     9        INIT_FCALL                                               'foo'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 ''
         12        DO_FCALL                                      0          
   17    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 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/43Gli
function name:  foo
number of ops:  17
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, ->15
          8    > > FE_FETCH_R                                               $5, !2, ->15
    6     9    >   ARRAY_KEY_EXISTS                                 ~6      !2, !0
         10        BOOL_NOT                                         ~7      ~6
         11      > JMPZ                                                     ~7, ->14
    7    12    >   ASSIGN_DIM                                               !0, !2
         13        OP_DATA                                                  !2
    5    14    > > JMP                                                      ->8
         15    >   FE_FREE                                                  $5
   10    16      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.18 ms | 1398 KiB | 20 Q