3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $array = array("1" => "PHP code tester Sandbox Online", "foo" => "bar", 5 , 5 => 89009, "case" => "Random Stuff", "PHP Version" => phpversion() ); function dotnot(array $data = []) { $ritit = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($data)); $result = array(); foreach ($ritit as $leafValue) { $keys = array(); $range = $ritit->getDepth(); ; // for($i=0; $i<$range; $i++) foreach (array_fill(0, $ritit->getDepth(), null) as $depth) { $keys[] = $ritit->getSubIterator($depth)->key(); } $result[implode('.', $keys)] = $leafValue; } return $result; } var_dump(dotnot($array ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lDfMA
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~1      'PHP+code+tester+Sandbox+Online', 1
    5     1        ADD_ARRAY_ELEMENT                                ~1      'bar', 'foo'
          2        ADD_ARRAY_ELEMENT                                ~1      5
          3        ADD_ARRAY_ELEMENT                                ~1      89009, 5
    6     4        ADD_ARRAY_ELEMENT                                ~1      'Random+Stuff', 'case'
    7     5        INIT_FCALL                                               'phpversion'
          6        DO_ICALL                                         $2      
          7        ADD_ARRAY_ELEMENT                                ~1      $2, 'PHP+Version'
    4     8        ASSIGN                                                   !0, ~1
   33     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'dotnot'
         11        SEND_VAR                                                 !0
         12        DO_FCALL                                      0  $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function dotnot:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 40
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 40
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 32
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 32
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/lDfMA
function name:  dotnot
number of ops:  43
compiled vars:  !0 = $data, !1 = $ritit, !2 = $result, !3 = $leafValue, !4 = $keys, !5 = $range, !6 = $depth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                        !0      <array>
   12     1        NEW                                              $7      'RecursiveIteratorIterator'
          2        NEW                                              $8      'RecursiveArrayIterator'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $8
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   13     8        ASSIGN                                                   !2, <array>
   15     9      > FE_RESET_R                                       $13     !1, ->40
         10    > > FE_FETCH_R                                               $13, !3, ->40
   17    11    >   ASSIGN                                                   !4, <array>
   18    12        INIT_METHOD_CALL                                         !1, 'getDepth'
         13        DO_FCALL                                      0  $15     
         14        ASSIGN                                                   !5, $15
   22    15        INIT_FCALL                                               'array_fill'
         16        SEND_VAL                                                 0
         17        INIT_METHOD_CALL                                         !1, 'getDepth'
         18        DO_FCALL                                      0  $17     
         19        SEND_VAR                                                 $17
         20        SEND_VAL                                                 null
         21        DO_ICALL                                         $18     
         22      > FE_RESET_R                                       $19     $18, ->32
         23    > > FE_FETCH_R                                               $19, !6, ->32
   24    24    >   INIT_METHOD_CALL                                         !1, 'getSubIterator'
         25        SEND_VAR_EX                                              !6
         26        DO_FCALL                                      0  $21     
         27        INIT_METHOD_CALL                                         $21, 'key'
         28        DO_FCALL                                      0  $22     
         29        ASSIGN_DIM                                               !4
         30        OP_DATA                                                  $22
   22    31      > JMP                                                      ->23
         32    >   FE_FREE                                                  $19
   27    33        INIT_FCALL                                               'implode'
         34        SEND_VAL                                                 '.'
         35        SEND_VAR                                                 !4
         36        DO_ICALL                                         $23     
         37        ASSIGN_DIM                                               !2, $23
         38        OP_DATA                                                  !3
   15    39      > JMP                                                      ->10
         40    >   FE_FREE                                                  $13
   30    41      > RETURN                                                   !2
   31    42*     > RETURN                                                   null

End of function dotnot

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.2 ms | 1403 KiB | 22 Q