3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = range(0, 5); $pop = function() use (& $pop, & $arr) { var_dump(array_pop($arr)); $pop(); }; $pop(); /* * Expected: * int(5) * int(4) * int(3) * int(2) * int(1) * int(0) * * Actual: * Fatal error: Maximum function nesting level */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tALef
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr, !1 = $pop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 5
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    4     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FtALef%3A4%240'
          6        BIND_LEXICAL                                             ~4, !1
          7        BIND_LEXICAL                                             ~4, !0
          8        ASSIGN                                                   !1, ~4
   10     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
   23    11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FtALef%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tALef
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $pop, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
    5     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'array_pop'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
    7     8        INIT_DYNAMIC_CALL                                        !0
          9        DO_FCALL                                      0          
    8    10      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FtALef%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.71 ms | 1395 KiB | 19 Q