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      'AppendIterator'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    5     3        INIT_METHOD_CALL                                         !0, 'append'
          4        NEW                                              $4      'NoRewindIterator'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsImTa%3A5%240'
          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      'NoRewindIterator'
         14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsImTa%3A6%241'
         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_ICALL                                         $15     
         28        SEND_VAR                                                 $15
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsImTa%3A5%240:
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 >   GENERATOR_CREATE                                         
          1        YIELD                                            $0      1
          2      > GENERATOR_RETURN                                         
          3*     > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FsImTa%3A5%240

Function %00%7Bclosure%7D%2Fin%2FsImTa%3A6%241:
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 >   GENERATOR_CREATE                                         
          1        YIELD                                            $0      2
          2      > GENERATOR_RETURN                                         
          3*     > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FsImTa%3A6%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.94 ms | 1392 KiB | 17 Q