3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); function generate_ints($n){ $a = array(0,1,2,3); foreach ( $a as $number) { yield $number; } } $gen = generate_ints(3); echo $gen->current(); $gen->next(); echo $gen->current(); $gen->next(); echo $gen->current(); $gen->next(); echo $gen->current(); $gen->next();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fl2nL
function name:  (null)
number of ops:  28
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   10     3        INIT_FCALL                                               'generate_ints'
          4        SEND_VAL                                                 3
          5        DO_FCALL                                      0  $2      
          6        ASSIGN                                                   !0, $2
   11     7        INIT_METHOD_CALL                                         !0, 'current'
          8        DO_FCALL                                      0  $4      
          9        ECHO                                                     $4
   12    10        INIT_METHOD_CALL                                         !0, 'next'
         11        DO_FCALL                                      0          
   14    12        INIT_METHOD_CALL                                         !0, 'current'
         13        DO_FCALL                                      0  $6      
         14        ECHO                                                     $6
   15    15        INIT_METHOD_CALL                                         !0, 'next'
         16        DO_FCALL                                      0          
   17    17        INIT_METHOD_CALL                                         !0, 'current'
         18        DO_FCALL                                      0  $8      
         19        ECHO                                                     $8
   18    20        INIT_METHOD_CALL                                         !0, 'next'
         21        DO_FCALL                                      0          
   20    22        INIT_METHOD_CALL                                         !0, 'current'
         23        DO_FCALL                                      0  $10     
         24        ECHO                                                     $10
   21    25        INIT_METHOD_CALL                                         !0, 'next'
         26        DO_FCALL                                      0          
         27      > RETURN                                                   1

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

End of function generate_ints

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.37 ms | 1403 KiB | 16 Q