3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
Branch analysis from position: 3
Branch analysis from position: 14
filename:       /in/bjIMD
function name:  foo
number of ops:  21
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                                                      ->15
    4     3    >   ECHO                                                     'In+generator+foo.......'
          4        ECHO                                                     '%0A'
    5     5        YIELD                                            $3      !0
          6        ASSIGN                                                   !1, $3
    6     7        ISSET_ISEMPTY_CV                                         !1
          8      > JMPZ                                                     ~5, ->14
    7     9    >   ECHO                                                     'generator+foo+displaying+sent+data+...'
    8    10        NOP                                                      
         11        FAST_CONCAT                                      ~6      'Sent+data+is+', !1
         12        ECHO                                                     ~6
         13        ECHO                                                     '%0A'
    3    14    >   PRE_INC                                                  !0
         15    >   IS_SMALLER                                               !0, 12
         16      > JMPNZ                                                    ~8, ->3
   12    17    >   ECHO                                                     'generator+done+and+closed.'
         18        ECHO                                                     '%0A'
   13    19      > GENERATOR_RETURN                                         
   14    20*     > GENERATOR_RETURN                                         

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.1 ms | 1402 KiB | 14 Q