3v4l.org

run code in 300+ PHP versions simultaneously
<?php $outer = function () { echo "Outer<br>"; $times = 0; $inner = function () use ( $times ) { 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/teTAd
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%2FteTAd%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%2FteTAd%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/teTAd
function name:  {closure}
number of ops:  8
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%2FteTAd%3A6%241'
          3        BIND_LEXICAL                                             ~3, !0
          4        ASSIGN                                                   !1, ~3
   15     5        FETCH_CONSTANT                                   ~5      'inner'
          6      > RETURN                                                   ~5
   16     7*     > RETURN                                                   null

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

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.55 ms | 935 KiB | 14 Q