3v4l.org

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

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

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.54 ms | 1403 KiB | 19 Q