3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printer() { echo "I'm printer!".PHP_EOL; while (true) { $string = yield; echo $string.PHP_EOL; } } $printer = printer(); $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/eUiiX
function name:  (null)
number of ops:  10
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, 'send'
          4        SEND_VAL_EX                                              'Hello+world%21'
          5        DO_FCALL                                      0          
   12     6        INIT_METHOD_CALL                                         !0, 'send'
          7        SEND_VAL_EX                                              'Bye+world%21'
          8        DO_FCALL                                      0          
          9      > 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/eUiiX
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      
          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:
148.71 ms | 1398 KiB | 14 Q