3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = range(0, 5); $pop = function() use (& $pop, & $arr) { $v = array_pop($arr); if ($v !== null) { var_dump($v); $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/tOOSC
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%2FtOOSC%3A4%240'
          6        BIND_LEXICAL                                             ~4, !1
          7        BIND_LEXICAL                                             ~4, !0
          8        ASSIGN                                                   !1, ~4
   14     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
   27    11      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.93 ms | 1396 KiB | 19 Q