3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printer() { while (true) { $string = yield 3; echo $string; } } $printer = printer(); $printer->send('Hello world!'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YbTLa
function name:  (null)
number of ops:  7
compiled vars:  !0 = $printer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'printer'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   10     3        INIT_METHOD_CALL                                         !0, 'send'
          4        SEND_VAL_EX                                              'Hello+world%21'
          5        DO_FCALL                                      0          
   11     6      > RETURN                                                   1

Function printer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 2
Branch analysis from position: 6
Branch analysis from position: 2
filename:       /in/YbTLa
function name:  printer
number of ops:  7
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    3     1      > JMP                                                      ->5
    4     2    >   YIELD                                            $1      3
          3        ASSIGN                                                   !0, $1
    5     4        ECHO                                                     !0
    3     5    > > JMPNZ                                                    <true>, ->2
    7     6    > > GENERATOR_RETURN                                         

End of function printer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.59 ms | 1397 KiB | 14 Q