3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo($content, $keys) { return sizeof($keys) === 0 ? $content : foo([array_pop($keys) => $content], $keys); } print_r(foo('bar', ['a', 'b', 'c', 'd', 'e']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2tcJ5
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                                   'print_r'
          1        INIT_FCALL                                                   'foo'
          2        SEND_VAL                                                     'bar'
          3        SEND_VAL                                                     <array>
          4        DO_FCALL                                          0  $0      
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2tcJ5
function name:  foo
number of ops:  18
compiled vars:  !0 = $content, !1 = $keys
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    3     2        COUNT                                                ~2      !1
          3        IS_IDENTICAL                                                 ~2, 0
          4      > JMPZ                                                         ~3, ->7
          5    >   QM_ASSIGN                                            ~4      !0
          6      > JMP                                                          ->16
          7    >   INIT_FCALL_BY_NAME                                           'foo'
          8        INIT_FCALL                                                   'array_pop'
          9        SEND_REF                                                     !1
         10        DO_ICALL                                             $5      
         11        INIT_ARRAY                                           ~6      !0, $5
         12        SEND_VAL_EX                                                  ~6
         13        SEND_VAR_EX                                                  !1
         14        DO_FCALL                                          0  $7      
         15        QM_ASSIGN                                            ~4      $7
         16    > > RETURN                                                       ~4
    4    17*     > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
213.29 ms | 2927 KiB | 16 Q