3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $g = (function(): \Generator { yield 'g'; return; yield 'n'; yield 'e'; })(); foreach ($g as $x) { var_dump($x); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/GE3Sm
function name:  (null)
number of ops:  12
compiled vars:  !0 = $g, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGE3Sm%3A4%240'
    9     1        INIT_DYNAMIC_CALL                                        ~2
          2        DO_FCALL                                      0  $3      
    4     3        ASSIGN                                                   !0, $3
   11     4      > FE_RESET_R                                       $5      !0, ->10
          5    > > FE_FETCH_R                                               $5, !1, ->10
   12     6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   11     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $5
   13    11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGE3Sm%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/GE3Sm
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GENERATOR_CREATE                                         
    5     1        YIELD                                                    'g'
    6     2      > GENERATOR_RETURN                                         
    7     3*       YIELD                                                    'n'
    8     4*       YIELD                                                    'e'
    9     5*     > GENERATOR_RETURN                                         

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.44 ms | 940 KiB | 16 Q