3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = (object)[ (object)[ "totals_grouped_by" => "day", "totals" => (object)[ "2018-05-25" => (object)[ "sales" => "0.00", "orders" => 0, "items" => 0, "tax" => "0.00", "shipping" => "0.00", "discount" => "0.00", "customers" => 0 ], "2018-05-26" => (object)[ "sales" => "0.00", "orders" => 0, "items" => 0, "tax" => "0.00", "shipping" => "0.00", "discount" => "0.00", "customers" => 0 ], "2018-05-27" => (object)[ "sales" => "0.00", "orders" => 0, "items" => 0, "tax" => "0.00", "shipping" => "0.00", "discount" => "0.00", "customers" => 0 ] ] ] ]; foreach($results as $val) { echo "Proof of mostly-accurate multi-dimensional array structure: " , $val->totals_grouped_by; } echo "\n---\n"; foreach ($results as $val) { foreach ($val->totals as $date => $subarray) { echo "Showing $date: "; var_export($subarray); echo "\n"; } } // or assuming all levels are objects and you only want the one "totals" object that you posted: echo "\n---\n"; foreach ($results->{0}->totals as $date => $subarray) { echo "Showing $date: "; var_export($subarray); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 38
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 38
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 36
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 36
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 36
Branch analysis from position: 38
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 54
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 54
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 38
Branch analysis from position: 19
filename:       /in/HWMCD
function name:  (null)
number of ops:  56
compiled vars:  !0 = $results, !1 = $val, !2 = $subarray, !3 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~4      'day', 'totals_grouped_by'
    7     1        CAST                                          8  ~5      <array>
          2        INIT_ARRAY                                       ~6      ~5, '2018-05-25'
   10     3        CAST                                          8  ~7      <array>
          4        ADD_ARRAY_ELEMENT                                ~6      ~7, '2018-05-26'
   13     5        CAST                                          8  ~8      <array>
          6        ADD_ARRAY_ELEMENT                                ~6      ~8, '2018-05-27'
          7        CAST                                          8  ~9      ~6
          8        ADD_ARRAY_ELEMENT                                ~4      ~9, 'totals'
          9        CAST                                          8  ~10     ~4
         10        INIT_ARRAY                                       ~11     ~10
         11        CAST                                          8  ~12     ~11
    2    12        ASSIGN                                                   !0, ~12
   19    13      > FE_RESET_R                                       $14     !0, ->19
         14    > > FE_FETCH_R                                               $14, !1, ->19
   20    15    >   ECHO                                                     'Proof+of+mostly-accurate+multi-dimensional+array+structure%3A+'
         16        FETCH_OBJ_R                                      ~15     !1, 'totals_grouped_by'
         17        ECHO                                                     ~15
   19    18      > JMP                                                      ->14
         19    >   FE_FREE                                                  $14
   23    20        ECHO                                                     '%0A---%0A'
   25    21      > FE_RESET_R                                       $16     !0, ->38
         22    > > FE_FETCH_R                                               $16, !1, ->38
   26    23    >   FETCH_OBJ_R                                      ~17     !1, 'totals'
         24      > FE_RESET_R                                       $18     ~17, ->36
         25    > > FE_FETCH_R                                       ~19     $18, !2, ->36
         26    >   ASSIGN                                                   !3, ~19
   27    27        ROPE_INIT                                     3  ~22     'Showing+'
         28        ROPE_ADD                                      1  ~22     ~22, !3
         29        ROPE_END                                      2  ~21     ~22, '%3A+'
         30        ECHO                                                     ~21
   28    31        INIT_FCALL                                               'var_export'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                                 
   29    34        ECHO                                                     '%0A'
   26    35      > JMP                                                      ->25
         36    >   FE_FREE                                                  $18
   25    37      > JMP                                                      ->22
         38    >   FE_FREE                                                  $16
   34    39        ECHO                                                     '%0A---%0A'
   36    40        FETCH_OBJ_R                                      ~25     !0, '0'
         41        FETCH_OBJ_R                                      ~26     ~25, 'totals'
         42      > FE_RESET_R                                       $27     ~26, ->54
         43    > > FE_FETCH_R                                       ~28     $27, !2, ->54
         44    >   ASSIGN                                                   !3, ~28
   37    45        ROPE_INIT                                     3  ~31     'Showing+'
         46        ROPE_ADD                                      1  ~31     ~31, !3
         47        ROPE_END                                      2  ~30     ~31, '%3A+'
         48        ECHO                                                     ~30
   38    49        INIT_FCALL                                               'var_export'
         50        SEND_VAR                                                 !2
         51        DO_ICALL                                                 
   39    52        ECHO                                                     '%0A'
   36    53      > JMP                                                      ->43
         54    >   FE_FREE                                                  $27
   40    55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.01 ms | 1400 KiB | 15 Q