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

End of function dotnot

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.27 ms | 1403 KiB | 22 Q