3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(): \Generator { if (true) { yield; } foreach (range(1, 20) as $i) { yield $i; } } var_dump(test()); var_dump(test()->valid());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bXvZ0
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'test'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   16     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'test'
          7        DO_FCALL                                      0  $2      
          8        INIT_METHOD_CALL                                         $2, 'valid'
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 11
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 3
filename:       /in/bXvZ0
function name:  test
number of ops:  13
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GENERATOR_CREATE                                         
    6     1      > JMPZ                                                     <true>, ->3
    7     2    >   YIELD                                                    
   10     3    >   INIT_FCALL                                               'range'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 20
          6        DO_ICALL                                         $2      
          7      > FE_RESET_R                                       $3      $2, ->11
          8    > > FE_FETCH_R                                               $3, !0, ->11
   11     9    >   YIELD                                                    !0
   10    10      > JMP                                                      ->8
         11    >   FE_FREE                                                  $3
   13    12      > GENERATOR_RETURN                                         

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.12 ms | 1015 KiB | 17 Q