3v4l.org

run code in 500+ PHP versions simultaneously
<?php $gen1 = static function () { yield true => true; }; $gen2 = static function () { yield false => false; }; $ait = new AppendIterator(); $ait->append($gen1()); $ait->append($gen2()); foreach ($ait as $k => $v) { var_dump($k, $v); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/gSPtO
function name:  (null)
number of ops:  27
compiled vars:  !0 = $gen1, !1 = $gen2, !2 = $ait, !3 = $v, !4 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          1        ASSIGN                                                       !0, ~5
    7     2        DECLARE_LAMBDA_FUNCTION                              ~7      [1]
          3        ASSIGN                                                       !1, ~7
   11     4        NEW                                                  $9      'AppendIterator'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !2, $9
   13     7        INIT_METHOD_CALL                                             !2, 'append'
          8        INIT_DYNAMIC_CALL                                            !0
          9        DO_FCALL                                          0  $12     
         10        SEND_VAR_NO_REF_EX                                           $12
         11        DO_FCALL                                          0          
   14    12        INIT_METHOD_CALL                                             !2, 'append'
         13        INIT_DYNAMIC_CALL                                            !1
         14        DO_FCALL                                          0  $14     
         15        SEND_VAR_NO_REF_EX                                           $14
         16        DO_FCALL                                          0          
   16    17      > FE_RESET_R                                           $16     !2, ->25
         18    > > FE_FETCH_R                                           ~17     $16, !3, ->25
         19    >   ASSIGN                                                       !4, ~17
   17    20        INIT_FCALL                                                   'var_dump'
         21        SEND_VAR                                                     !4
         22        SEND_VAR                                                     !3
         23        DO_ICALL                                                     
   16    24      > JMP                                                          ->18
         25    >   FE_FREE                                                      $16
   18    26      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/gSPtO
function name:  {closure:/in/gSPtO:3}
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                             
    4     1        YIELD                                                        <true>, <true>
    5     2      > GENERATOR_RETURN                                             

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/gSPtO
function name:  {closure:/in/gSPtO:7}
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   GENERATOR_CREATE                                             
    8     1        YIELD                                                        <false>, <false>
    9     2      > GENERATOR_RETURN                                             

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.85 ms | 1464 KiB | 14 Q