3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { for ($i = 0; $i < 10000; $i++) { } echo "Yay"; } function main() { $generator = (yield gen()); echo "Lold"; } main();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WH9RL
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'main'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 2
Branch analysis from position: 5
Branch analysis from position: 2
filename:       /in/WH9RL
function name:  gen
number of ops:  7
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->3
          2    >   PRE_INC                                                  !0
          3    >   IS_SMALLER                                               !0, 10000
          4      > JMPNZ                                                    ~3, ->2
    6     5    >   ECHO                                                     'Yay'
    7     6      > RETURN                                                   null

End of function gen

Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/WH9RL
function name:  main
number of ops:  7
compiled vars:  !0 = $generator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   GENERATOR_CREATE                                         
   10     1        INIT_FCALL                                               'gen'
          2        DO_FCALL                                      0  $1      
          3        YIELD                                            $2      $1
          4        ASSIGN                                                   !0, $2
   11     5        ECHO                                                     'Lold'
   12     6      > GENERATOR_RETURN                                         

End of function main

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.41 ms | 1397 KiB | 15 Q