3v4l.org

run code in 300+ PHP versions simultaneously
<?php $outer = function () { echo "Outer<br>"; $times = 0; $inner = function () use ( $times, &$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/UetAo
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%2FUetAo%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%2FUetAo%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UetAo
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $times, !1 = $inner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Outer%3Cbr%3E'
    4     1        ASSIGN                                                   !0, 0
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUetAo%3A6%241'
          3        BIND_LEXICAL                                             ~3, !0
          4        BIND_LEXICAL                                             ~3, !1
          5        ASSIGN                                                   !1, ~3
   15     6        FETCH_CONSTANT                                   ~5      'inner'
          7      > RETURN                                                   ~5
   16     8*     > RETURN                                                   null

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

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

End of function %00%7Bclosure%7D%2Fin%2FUetAo%3A6%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.08 ms | 1395 KiB | 13 Q