3v4l.org

run code in 300+ PHP versions simultaneously
<?php function data() { echo __FUNCTION__; return [1,2,3]; } function test() { echo __FUNCTION__; yield from data(); } $generator = test(); echo "START"; foreach($test as $num);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/L3E7n
function name:  (null)
number of ops:  9
compiled vars:  !0 = $generator, !1 = $test, !2 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
   15     3        ECHO                                                     'START'
   16     4      > FE_RESET_R                                       $5      !1, ->7
          5    > > FE_FETCH_R                                               $5, !2, ->7
          6    > > JMP                                                      ->5
          7    >   FE_FREE                                                  $5
          8      > RETURN                                                   1

Function data:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L3E7n
function name:  data
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'data'
    5     1      > RETURN                                                   <array>
    6     2*     > RETURN                                                   null

End of function data

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/L3E7n
function name:  test
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   GENERATOR_CREATE                                         
   10     1        ECHO                                                     'test'
   11     2        INIT_FCALL                                               'data'
          3        DO_FCALL                                      0  $0      
          4        YIELD_FROM                                       ~1      $0
          5        FREE                                                     ~1
   12     6      > GENERATOR_RETURN                                         

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.49 ms | 1398 KiB | 15 Q