3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=67497 @eval('abc'); class t1 { public function test() { $values = array(1, 2); foreach ($values as $value) { yield $value; } } } $t1 = new t1; $values = $t1->test(); foreach ($values as $value) { var_dump($value); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/CG4Zo
function name:  (null)
number of ops:  17
compiled vars:  !0 = $t1, !1 = $values, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BEGIN_SILENCE                                    ~3      
          1        INCLUDE_OR_EVAL                                          'abc', EVAL
          2        END_SILENCE                                              ~3
   19     3        NEW                                              $5      't1'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $5
   20     6        INIT_METHOD_CALL                                         !0, 'test'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !1, $8
   22     9      > FE_RESET_R                                       $10     !1, ->15
         10    > > FE_FETCH_R                                               $10, !2, ->15
   24    11    >   INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   22    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $10
   25    16      > RETURN                                                   1

Class t1:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
filename:       /in/CG4Zo
function name:  test
number of ops:  8
compiled vars:  !0 = $values, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   GENERATOR_CREATE                                         
   10     1        ASSIGN                                                   !0, <array>
   12     2      > FE_RESET_R                                       $3      !0, ->6
          3    > > FE_FETCH_R                                               $3, !1, ->6
   14     4    >   YIELD                                                    !1
   12     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $3
   16     7      > GENERATOR_RETURN                                         

End of function test

End of class t1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.7 ms | 1388 KiB | 15 Q