3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sponges = function() { for ($i = 1; $i <= 3; $i++) { // Note that $i is preserved between yields. yield $i; } }; echo is_callable($sponges); $generator = $sponges(); foreach ($generator as $value) { echo "$value\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/JBFLE
function name:  (null)
number of ops:  17
compiled vars:  !0 = $sponges, !1 = $generator, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJBFLE%3A3%240'
          1        ASSIGN                                                   !0, ~3
   10     2        INIT_FCALL                                               'is_callable'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ECHO                                                     $5
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   13     9      > FE_RESET_R                                       $8      !1, ->15
         10    > > FE_FETCH_R                                               $8, !2, ->15
   14    11    >   NOP                                                      
         12        FAST_CONCAT                                      ~9      !2, '%0A'
         13        ECHO                                                     ~9
   13    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $8
   15    16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJBFLE%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 3
Branch analysis from position: 7
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 3
Branch analysis from position: 7
Branch analysis from position: 3
filename:       /in/JBFLE
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 1
          2      > JMP                                                      ->5
    6     3    >   YIELD                                                    !0
    4     4        PRE_INC                                                  !0
          5    >   IS_SMALLER_OR_EQUAL                                      !0, 3
          6      > JMPNZ                                                    ~4, ->3
    8     7    > > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FJBFLE%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.87 ms | 1396 KiB | 15 Q