3v4l.org

run code in 300+ PHP versions simultaneously
<?php $outer = function () { echo "Outer<br>"; $times = 0; function inner () { echo "Inner : ${times}<br>"; $times++; if ( $times <= 2 ){ inner(); } }; return inner; }; $inner = $outer(); $inner(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P49M4
function name:  (null)
number of ops:  8
compiled vars:  !0 = $outer, !1 = $inner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FP49M4%3A2%240'
          1        ASSIGN                                                   !0, ~2
   18     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   19     5        INIT_DYNAMIC_CALL                                        !1
          6        DO_FCALL                                      0          
   20     7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FP49M4%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P49M4
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $times
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Outer%3Cbr%3E'
    4     1        ASSIGN                                                   !0, 0
    6     2        DECLARE_FUNCTION                                         'inner'
   15     3        FETCH_CONSTANT                                   ~2      'inner'
          4      > RETURN                                                   ~2
   16     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FP49M4%3A2%240

Function %00inner%2Fin%2FP49M4%3A6%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/P49M4
function name:  inner
number of ops:  10
compiled vars:  !0 = $times
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ROPE_INIT                                     3  ~2      'Inner+%3A+'
          1        ROPE_ADD                                      1  ~2      ~2, !0
          2        ROPE_END                                      2  ~1      ~2, '%3Cbr%3E'
          3        ECHO                                                     ~1
    8     4        PRE_INC                                                  !0
    9     5        IS_SMALLER_OR_EQUAL                                      !0, 2
          6      > JMPZ                                                     ~5, ->9
   10     7    >   INIT_FCALL_BY_NAME                                       'inner'
          8        DO_FCALL                                      0          
   13     9    > > RETURN                                                   null

End of function %00inner%2Fin%2FP49M4%3A6%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.47 ms | 1395 KiB | 13 Q