3v4l.org

run code in 300+ PHP versions simultaneously
<?php $callbacks = new SplStack(); // Setup with lots of callbacks for ($i = 0; $i < 1000; $i++) { $callbacks->push(function () use ($i) { return $i; }); } foreach ($callbacks as $callback) { echo $callback() .PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
Branch analysis from position: 5
filename:       /in/AP1nE
function name:  (null)
number of ops:  22
compiled vars:  !0 = $callbacks, !1 = $i, !2 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'SplStack'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    6     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->11
    7     5    >   INIT_METHOD_CALL                                         !0, 'push'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAP1nE%3A7%240'
          7        BIND_LEXICAL                                             ~7, !1
          8        SEND_VAL_EX                                              ~7
          9        DO_FCALL                                      0          
    6    10        PRE_INC                                                  !1
         11    >   IS_SMALLER                                               !1, 1000
         12      > JMPNZ                                                    ~10, ->5
   10    13    > > FE_RESET_R                                       $11     !0, ->20
         14    > > FE_FETCH_R                                               $11, !2, ->20
   11    15    >   INIT_DYNAMIC_CALL                                        !2
         16        DO_FCALL                                      0  $12     
         17        CONCAT                                           ~13     $12, '%0A'
         18        ECHO                                                     ~13
   10    19      > JMP                                                      ->14
         20    >   FE_FREE                                                  $11
   12    21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAP1nE%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AP1nE
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAP1nE%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.06 ms | 1386 KiB | 13 Q