3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Foo() { for ($i = 11; $i < 12; $i++) { $string=(yield $i); if (isset($string)) { echo "$string\n"; } } return; } $gen = foo(); foreach ($gen as $value) { echo "value is $value\n"; if ($value == 11) { $gen->send('Hello World'); } } unset($gen);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/iuhe9
function name:  (null)
number of ops:  18
compiled vars:  !0 = $gen, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   12     3      > FE_RESET_R                                       $4      !0, ->15
          4    > > FE_FETCH_R                                               $4, !1, ->15
   13     5    >   ROPE_INIT                                     3  ~6      'value+is+'
          6        ROPE_ADD                                      1  ~6      ~6, !1
          7        ROPE_END                                      2  ~5      ~6, '%0A'
          8        ECHO                                                     ~5
   14     9        IS_EQUAL                                                 !1, 11
         10      > JMPZ                                                     ~8, ->14
   15    11    >   INIT_METHOD_CALL                                         !0, 'send'
         12        SEND_VAL_EX                                              'Hello+World'
         13        DO_FCALL                                      0          
   12    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $4
   18    16        UNSET_CV                                                 !0
         17      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
Branch analysis from position: 10
filename:       /in/iuhe9
function name:  Foo
number of ops:  15
compiled vars:  !0 = $i, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    3     1        ASSIGN                                                   !0, 11
          2      > JMP                                                      ->11
    4     3    >   YIELD                                            $3      !0
          4        ASSIGN                                                   !1, $3
    5     5        ISSET_ISEMPTY_CV                                         !1
          6      > JMPZ                                                     ~5, ->10
    6     7    >   NOP                                                      
          8        FAST_CONCAT                                      ~6      !1, '%0A'
          9        ECHO                                                     ~6
    3    10    >   PRE_INC                                                  !0
         11    >   IS_SMALLER                                               !0, 12
         12      > JMPNZ                                                    ~8, ->3
    9    13    > > GENERATOR_RETURN                                         
   10    14*     > GENERATOR_RETURN                                         

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.25 ms | 1403 KiB | 14 Q