3v4l.org

run code in 300+ PHP versions simultaneously
<?php $recursive = function (&$argument) { global $recursive; if (count($argument) < 10) { $argument[] = 'foo'; $recursive($argument); // line 10 } }; $arr = array(); $recursive($arr); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/USGFD
function name:  (null)
number of ops:  10
compiled vars:  !0 = $recursive, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        ASSIGN                                                   !0, ~2
   12     2        ASSIGN                                                   !1, <array>
   13     3        INIT_DYNAMIC_CALL                                        !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   14     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/USGFD
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $argument, !1 = $recursive
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        BIND_GLOBAL                                              !1, 'recursive'
    6     2        COUNT                                            ~2      !0
          3        IS_SMALLER                                               ~2, 10
          4      > JMPZ                                                     ~3, ->10
    8     5    >   ASSIGN_DIM                                               !0
          6        OP_DATA                                                  'foo'
    9     7        INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   11    10    > > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.07 ms | 1005 KiB | 14 Q