3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'foo', 'bar' ]; function foo($array) { static $index = 0; if (!isset($array[$index])) { return array(); } $bar[$array[$index]] = foo($array) and ++$index; return $bar; } foo($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8jt4
function name:  (null)
number of ops:  5
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'foo'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/G8jt4
function name:  foo
number of ops:  17
compiled vars:  !0 = $array, !1 = $index, !2 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        BIND_STATIC                                              !1
   12     2        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !0, !1
          3        BOOL_NOT                                         ~4      ~3
          4      > JMPZ                                                     ~4, ->6
   13     5    > > RETURN                                                   <array>
   16     6    >   FETCH_DIM_R                                      ~5      !0, !1
          7        INIT_FCALL_BY_NAME                                       'foo'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $7      
         10        ASSIGN_DIM                                       ~6      !2, ~5
         11        OP_DATA                                                  $7
         12      > JMPZ_EX                                          ~6      ~6, ->15
         13    >   PRE_INC                                          ~8      !1
         14        BOOL                                             ~6      ~8
   18    15    > > RETURN                                                   !2
   19    16*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.7 ms | 1398 KiB | 14 Q