3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { yield 42; }; $xs = gen(); $xs->next(); var_dump($xs->current()); foreach ($xs as $x) { var_dump($x); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/RupJL
function name:  (null)
number of ops:  18
compiled vars:  !0 = $xs, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
          3        INIT_METHOD_CALL                                         !0, 'next'
          4        DO_FCALL                                      0          
          5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'current'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
    5    10      > FE_RESET_R                                       $7      !0, ->16
         11    > > FE_FETCH_R                                               $7, !1, ->16
         12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $7
         17      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/RupJL
function name:  gen
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
          1        YIELD                                                    42
          2      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.57 ms | 1398 KiB | 16 Q