3v4l.org

run code in 300+ PHP versions simultaneously
<?php function g() { foreach (["a","b","c"] as $val) { yield $val; } var_dump(yield); var_dump(yield); var_dump(yield); } $g = g(); foreach ($g as $i => $v) { var_dump($v); } $g->send(1); $g->send(2); $g->send(3);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/BLh7a
function name:  (null)
number of ops:  21
compiled vars:  !0 = $g, !1 = $v, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'g'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
   14     3      > FE_RESET_R                                       $5      !0, ->10
          4    > > FE_FETCH_R                                       ~6      $5, !1, ->10
          5    >   ASSIGN                                                   !2, ~6
   15     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   14     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $5
   17    11        INIT_METHOD_CALL                                         !0, 'send'
         12        SEND_VAL_EX                                              1
         13        DO_FCALL                                      0          
   18    14        INIT_METHOD_CALL                                         !0, 'send'
         15        SEND_VAL_EX                                              2
         16        DO_FCALL                                      0          
   19    17        INIT_METHOD_CALL                                         !0, 'send'
         18        SEND_VAL_EX                                              3
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Function g:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 5
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 5
filename:       /in/BLh7a
function name:  g
number of ops:  19
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1      > FE_RESET_R                                       $1      <array>, ->5
          2    > > FE_FETCH_R                                               $1, !0, ->5
    5     3    >   YIELD                                                    !0
    4     4      > JMP                                                      ->2
          5    >   FE_FREE                                                  $1
    7     6        INIT_FCALL                                               'var_dump'
          7        YIELD                                            $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'var_dump'
         11        YIELD                                            $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                                 
    9    14        INIT_FCALL                                               'var_dump'
         15        YIELD                                            $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
   10    18      > GENERATOR_RETURN                                         

End of function g

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.46 ms | 1403 KiB | 16 Q