3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printer() { $status=true; while ($i) { $string = yield; yield $string; $status=false; } echo 'Generator is still working? ',($status == false)? 'false' : 'true'; return; } $printer = printer(); $printer->send('Hello world!'); echo $printer->current(); echo $printer->next(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eiJuB
function name:  (null)
number of ops:  13
compiled vars:  !0 = $printer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'printer'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'send'
          4        SEND_VAL_EX                                              'Hello+world%21'
          5        DO_FCALL                                      0          
   15     6        INIT_METHOD_CALL                                         !0, 'current'
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
   16     9        INIT_METHOD_CALL                                         !0, 'next'
         10        DO_FCALL                                      0  $5      
         11        ECHO                                                     $5
   17    12      > 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
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 13
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/eiJuB
function name:  printer
number of ops:  17
compiled vars:  !0 = $status, !1 = $string, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    3     1        ASSIGN                                                   !0, <true>
    4     2      > JMP                                                      ->7
    5     3    >   YIELD                                            $4      
          4        ASSIGN                                                   !1, $4
    6     5        YIELD                                                    !1
    7     6        ASSIGN                                                   !0, <false>
    4     7    > > JMPNZ                                                    !2, ->3
    9     8    >   ECHO                                                     'Generator+is+still+working%3F+'
          9        BOOL_NOT                                         ~8      !0
         10      > JMPZ                                                     ~8, ->13
         11    >   QM_ASSIGN                                        ~9      'false'
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~9      'true'
         14    >   ECHO                                                     ~9
   10    15      > GENERATOR_RETURN                                         
   11    16*     > GENERATOR_RETURN                                         

End of function printer

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.3 ms | 1399 KiB | 14 Q