3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [['ONE'], ['TWO', 'THREE', 'FOUR'], ['FIVE']]; $iterator = new RecursiveIteratorIterator( new RecursiveArrayIterator( $array, RecursiveArrayIterator::CHILD_ARRAYS_ONLY ) ); $test = (function() { yield 'ONE'; yield from (function() { yield 'TWO'; yield 'THREE'; yield 'FOUR'; })(); yield 'FIVE'; })(); var_dump(iterator_to_array($test)); var_dump(iterator_to_array($iterator));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ViGQZ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $iterator, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        NEW                                              $4      'RecursiveIteratorIterator'
    5     2        NEW                                              $5      'RecursiveArrayIterator'
    6     3        SEND_VAR_EX                                              !0
    7     4        SEND_VAL_EX                                              4
    5     5        DO_FCALL                                      0          
    7     6        SEND_VAR_NO_REF_EX                                       $5
    4     7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $4
   11     9        DECLARE_LAMBDA_FUNCTION                          ~9      [0]
   21    10        INIT_DYNAMIC_CALL                                        ~9
         11        DO_FCALL                                      0  $10     
   11    12        ASSIGN                                                   !2, $10
   23    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'iterator_to_array'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        SEND_VAR                                                 $12
         18        DO_ICALL                                                 
   24    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'iterator_to_array'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $14     
         23        SEND_VAR                                                 $14
         24        DO_ICALL                                                 
         25      > 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/ViGQZ
function name:  {closure}
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   GENERATOR_CREATE                                         
   12     1        YIELD                                                    'ONE'
   14     2        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
   18     3        INIT_DYNAMIC_CALL                                        ~1
          4        DO_FCALL                                      0  $2      
          5        YIELD_FROM                                       ~3      $2
          6        FREE                                                     ~3
   20     7        YIELD                                                    'FIVE'
   21     8      > GENERATOR_RETURN                                         


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

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.05 ms | 1021 KiB | 15 Q