3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = new AppendIterator(); $i->append(new NoRewindIterator((fn ()=> yield 1)())); $i->append(new NoRewindIterator((fn ()=> yield 2)())); var_dump($i); var_dump(iterator_to_array($i));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sImTa
function name:  (null)
number of ops:  31
compiled vars:  !0 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $1      :57
         1        DO_FCALL                                      0          
         2        ASSIGN                                                   !0, $1
   5     3        INIT_METHOD_CALL                                         !0, 'append'
         4        NEW                                              $4      :53
         5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsImTa0x7f5f964792e9'
         6        INIT_DYNAMIC_CALL                                        ~5
         7        DO_FCALL                                      0  $6      
         8        SEND_VAR_NO_REF_EX                                       $6
         9        DO_FCALL                                      0          
        10        SEND_VAR_NO_REF_EX                                       $4
        11        DO_FCALL                                      0          
   6    12        INIT_METHOD_CALL                                         !0, 'append'
        13        NEW                                              $9      :40
        14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsImTa0x7f5f96479320'
        15        INIT_DYNAMIC_CALL                                        ~10
        16        DO_FCALL                                      0  $11     
        17        SEND_VAR_NO_REF_EX                                       $11
        18        DO_FCALL                                      0          
        19        SEND_VAR_NO_REF_EX                                       $9
        20        DO_FCALL                                      0          
   8    21        INIT_FCALL                                               'var_dump'
        22        SEND_VAR                                                 !0
        23        DO_ICALL                                                 
   9    24        INIT_FCALL                                               'var_dump'
        25        INIT_FCALL                                               'iterator_to_array'
        26        SEND_VAR                                                 !0
        27        DO_FCALL_BY_NAME                                         
        28        SEND_VAR                                                 $15
        29        DO_ICALL                                                 
        30      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsImTa0x7f5f964792e9:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/sImTa
function name:  {closure}
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   DECLARE_CLASS                                            
         1        YIELD                                            $0      1
         2      > GENERATOR_RETURN                                         
         3*     > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FsImTa0x7f5f964792e9

Function %00%7Bclosure%7D%2Fin%2FsImTa0x7f5f96479320:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/sImTa
function name:  {closure}
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   DECLARE_CLASS                                            
         1        YIELD                                            $0      2
         2      > GENERATOR_RETURN                                         
         3*     > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FsImTa0x7f5f96479320

Generated using Vulcan Logic Dumper, using php 7.4.0