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

End of function dotnot

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.75 ms | 1394 KiB | 20 Q