3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { final public function trigger() { $result = ( function() { yield 1; yield 2; yield 3; yield 4; yield 5; } ); return $result(); } } $test = new test(); $generator = $test->trigger(); foreach($generator as $value) { echo $value."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/30im8
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test, !1 = $generator, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $3      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   19     3        INIT_METHOD_CALL                                         !0, 'trigger'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   20     6      > FE_RESET_R                                       $8      !1, ->11
          7    > > FE_FETCH_R                                               $8, !2, ->11
   21     8    >   CONCAT                                           ~9      !2, '%0A'
          9        ECHO                                                     ~9
   20    10      > JMP                                                      ->7
         11    >   FE_FREE                                                  $8
   22    12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F30im8%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/30im8
function name:  {closure}
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   GENERATOR_CREATE                                         
    7     1        YIELD                                                    1
    8     2        YIELD                                                    2
    9     3        YIELD                                                    3
   10     4        YIELD                                                    4
   11     5        YIELD                                                    5
   12     6      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2F30im8%3A6%240

Class test:
Function trigger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/30im8
function name:  trigger
number of ops:  6
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F30im8%3A6%240'
    5     1        ASSIGN                                                   !0, ~1
   14     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $3      
          4      > RETURN                                                   $3
   15     5*     > RETURN                                                   null

End of function trigger

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.49 ms | 1395 KiB | 13 Q