3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump 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%2FP49M40x7f17ba07a0e9'
  16     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%2FP49M40x7f17ba07a0e9:
Finding entry points
Branch analysis from position: 0
Jump 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%2FP49M40x7f17ba07a0e9

Function %00inner%2Fin%2FP49M40x7f17ba07a0d3:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/P49M4
function name:  inner
number of ops:  11
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        POST_INC                                         ~4      !0
         5        FREE                                                     ~4
   9     6        IS_SMALLER_OR_EQUAL                              ~5      !0, 2
         7      > JMPZ                                                     ~5, ->10
  10     8    >   INIT_FCALL_BY_NAME                                       'inner'
         9        DO_FCALL                                      0          
  13    10    > > RETURN                                                   null

End of function %00inner%2Fin%2FP49M40x7f17ba07a0d3

Generated using Vulcan Logic Dumper, using php 7.2.0