3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { var_dump('a1'); yield 1; var_dump('a2'); yield 2; var_dump('a3'); } foreach (a() as $a) { var_dump(a); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/BpdLm
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'a'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->9
          3    > > FE_FETCH_R                                               $2, !0, ->9
   12     4    >   INIT_FCALL                                               'var_dump'
          5        FETCH_CONSTANT                                   ~3      'a'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   11     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $2
   13    10      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/BpdLm
function name:  a
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'a1'
          3        DO_ICALL                                                 
    5     4        YIELD                                                    1
    6     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAL                                                 'a2'
          7        DO_ICALL                                                 
    7     8        YIELD                                                    2
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAL                                                 'a3'
         11        DO_ICALL                                                 
    9    12      > GENERATOR_RETURN                                         

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.56 ms | 1389 KiB | 16 Q