3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = array( 0 => array( 0 => 1, ), 1 => array( 0 => 2, ), 2 => array( 0 => 3, 1 => 4, 2 => 5, ), 3 => array( 0 => 6, ), 4 => array( 0 => 7, ), ); $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($data)); echo PHP_EOL, implode(iterator_to_array($it)); //745 instead of 1234567 echo PHP_EOL, implode(iterator_to_array($it, true)); //745 instead of 1234567 echo PHP_EOL ; foreach($it as $v) { echo $v ; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/GJU7N
function name:  (null)
number of ops:  28
compiled vars:  !0 = $data, !1 = $it, !2 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   23     1        NEW                                                  $4      'RecursiveIteratorIterator'
          2        NEW                                                  $5      'RecursiveArrayIterator'
          3        SEND_VAR_EX                                                  !0
          4        DO_FCALL                                          0          
          5        SEND_VAR_NO_REF_EX                                           $5
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $4
   25     8        ECHO                                                         '%0A'
          9        INIT_FCALL                                                   'iterator_to_array'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                             $9      
         12        FRAMELESS_ICALL_1                implode             ~10     $9
         13        ECHO                                                         ~10
   26    14        ECHO                                                         '%0A'
         15        INIT_FCALL                                                   'iterator_to_array'
         16        SEND_VAR                                                     !1
         17        SEND_VAL                                                     <true>
         18        DO_ICALL                                             $11     
         19        FRAMELESS_ICALL_1                implode             ~12     $11
         20        ECHO                                                         ~12
   28    21        ECHO                                                         '%0A'
   30    22      > FE_RESET_R                                           $13     !1, ->26
         23    > > FE_FETCH_R                                                   $13, !2, ->26
   32    24    >   ECHO                                                         !2
   30    25      > JMP                                                          ->23
         26    >   FE_FREE                                                      $13
   33    27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.75 ms | 2935 KiB | 14 Q