3v4l.org

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

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.7 ms | 1010 KiB | 14 Q