3v4l.org

run code in 300+ PHP versions simultaneously
<?php $handlersList = []; for ($i = 0; $i < 25; $i++) { $handlersList[] = function() use ($i) { yield "Some Shit $i \n"; }; } $i = 0; while (true) { if ($i >= count($handlersList)) break; $func = $handlersList[$i++](); echo $func->current(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 12
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 12
Branch analysis from position: 25
Branch analysis from position: 12
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/S6Mf2
function name:  (null)
number of ops:  26
compiled vars:  !0 = $handlersList, !1 = $i, !2 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
    6     3    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FS6Mf2%3A6%240'
          4        BIND_LEXICAL                                             ~6, !1
          5        ASSIGN_DIM                                               !0
    8     6        OP_DATA                                                  ~6
    5     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 25
          9      > JMPNZ                                                    ~8, ->3
   11    10    >   ASSIGN                                                   !1, 0
   13    11      > JMP                                                      ->24
   14    12    >   COUNT                                            ~10     !0
         13        IS_SMALLER_OR_EQUAL                                      ~10, !1
         14      > JMPZ                                                     ~11, ->16
   15    15    > > JMP                                                      ->25
   16    16    >   POST_INC                                         ~12     !1
         17        FETCH_DIM_R                                      ~13     !0, ~12
         18        INIT_DYNAMIC_CALL                                        ~13
         19        DO_FCALL                                      0  $14     
         20        ASSIGN                                                   !2, $14
   17    21        INIT_METHOD_CALL                                         !2, 'current'
         22        DO_FCALL                                      0  $16     
         23        ECHO                                                     $16
   13    24    > > JMPNZ                                                    <true>, ->12
   18    25    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FS6Mf2%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/S6Mf2
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   GENERATOR_CREATE                                         
          1        BIND_STATIC                                              !0
    7     2        ROPE_INIT                                     3  ~2      'Some+Shit+'
          3        ROPE_ADD                                      1  ~2      ~2, !0
          4        ROPE_END                                      2  ~1      ~2, '+%0A'
          5        YIELD                                                    ~1
    8     6      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FS6Mf2%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.85 ms | 1399 KiB | 13 Q