3v4l.org

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

End of Dynamic Function 0

Dynamic Function 1
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/As0kH
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $argument, !1 = $recursive2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        COUNT                                            ~2      !0
          3        IS_SMALLER                                               ~2, 10
          4      > JMPZ                                                     ~3, ->10
   17     5    >   ASSIGN_DIM                                               !0
          6        OP_DATA                                                  'foo'
   18     7        INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   20    10    > > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.99 ms | 1015 KiB | 14 Q