3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($arr) { return iterator_to_array( new RecursiveIteratorIterator( new RecursiveArrayIterator($arr) ) ); } var_dump(test(array(1,2,3,4,array(5,6,array(7),8)))); var_dump(test(array(new stdClass, new stdClass)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZTnrA
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'test'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   12     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'test'
          8        NEW                                              $2      'stdClass'
          9        DO_FCALL                                      0          
         10        INIT_ARRAY                                       ~4      $2
         11        NEW                                              $5      'stdClass'
         12        DO_FCALL                                      0          
         13        ADD_ARRAY_ELEMENT                                ~4      $5
         14        SEND_VAL                                                 ~4
         15        DO_FCALL                                      0  $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZTnrA
function name:  test
number of ops:  12
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'iterator_to_array'
    5     2        NEW                                              $1      'RecursiveIteratorIterator'
    6     3        NEW                                              $2      'RecursiveArrayIterator'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $2
          7        DO_FCALL                                      0          
          8        SEND_VAR                                                 $1
          9        DO_ICALL                                         $5      
         10      > RETURN                                                   $5
    9    11*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.5 ms | 1399 KiB | 19 Q