3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(){ yield 1; yield 2; yield 3; }; $gen = test(); if ($gen instanceof Generator) { echo "\o/\n"; } else { echo ":( \n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ujDhr
function name:  (null)
number of ops:  9
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   11     3        INSTANCEOF                                               !0, 'Generator'
          4      > JMPZ                                                     ~3, ->7
   12     5    >   ECHO                                                     '%5Co%2F%0A'
          6      > JMP                                                      ->8
   14     7    >   ECHO                                                     '%3A%28+%0A'
   15     8    > > RETURN                                                   1

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.98 ms | 1397 KiB | 14 Q