3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { yield 'a' => 1; yield 'b' => 2; yield 'c' => 3; } $it = foo(); do { echo key($it), "\n", current($it), "\n"; } while($it->next());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/2plqj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   14     3    >   INIT_FCALL                                               'key'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ECHO                                                     $3
          7        ECHO                                                     '%0A'
          8        INIT_FCALL                                               'current'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        ECHO                                                     $4
         12        ECHO                                                     '%0A'
   15    13        INIT_METHOD_CALL                                         !0, 'next'
         14        DO_FCALL                                      0  $5      
         15      > JMPNZ                                                    $5, ->3
         16    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/2plqj
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    5     1        YIELD                                                    1, 'a'
    6     2        YIELD                                                    2, 'b'
    7     3        YIELD                                                    3, 'c'
    9     4      > GENERATOR_RETURN                                         

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.1 ms | 1389 KiB | 18 Q