3v4l.org

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

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

End of function printer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.29 ms | 1398 KiB | 16 Q