3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = '{"Saturday" : { "00-06" : "Non-stop", "19-22" : "Saturday Night Club Mix" }, "Sunday" : { "00-04" : "Party cool down", "04-24" : "Non-stop" }}'; //$days[] = json_decode($array, TRUE); /*foreach($days as $day=>$time) { echo '<div class="day">'; echo '<h2>' . $day . '</h2>'; echo '<ul>'; foreach($time as $timee=>$item) { echo '<li>'; echo '<span class="time">' . $timee . '</span>&nbsp;'; echo $item; echo '</li>'; } echo '</ul>'; echo '</div>'; }*/ $jsonIterator = new RecursiveIteratorIterator( new RecursiveArrayIterator(json_decode($array, TRUE)), RecursiveIteratorIterator::SELF_FIRST); foreach ($jsonIterator as $key => $val) { if(is_array($val)) { echo "$key:\n"; } else { echo "$key => $val\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 28
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/DDdJQ
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array, !1 = $jsonIterator, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22Saturday%22+%3A+%7B%0A%09%09%2200-06%22%09%3A%09%09%22Non-stop%22%2C%0A%09%09%2219-22%22%09%3A%09%09%22Saturday+Night+Club+Mix%22%0A++++%7D%2C%0A%09%22Sunday%22+%3A+%7B%0A%09%09%2200-04%22%09%3A%09%09%22Party+cool+down%22%2C%0A%09%09%2204-24%22%09%3A%09%09%22Non-stop%22%0A%7D%7D'
   28     1        NEW                                              $5      'RecursiveIteratorIterator'
   29     2        NEW                                              $6      'RecursiveArrayIterator'
          3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $7      
          7        SEND_VAR_NO_REF_EX                                       $7
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $6
   30    10        SEND_VAL_EX                                              1
         11        DO_FCALL                                      0          
   28    12        ASSIGN                                                   !1, $5
   32    13      > FE_RESET_R                                       $11     !1, ->28
         14    > > FE_FETCH_R                                       ~12     $11, !2, ->28
         15    >   ASSIGN                                                   !3, ~12
   33    16        TYPE_CHECK                                  128          !2
         17      > JMPZ                                                     ~14, ->22
   34    18    >   NOP                                                      
         19        FAST_CONCAT                                      ~15     !3, '%3A%0A'
         20        ECHO                                                     ~15
         21      > JMP                                                      ->27
   36    22    >   ROPE_INIT                                     4  ~17     !3
         23        ROPE_ADD                                      1  ~17     ~17, '+%3D%3E+'
         24        ROPE_ADD                                      2  ~17     ~17, !2
         25        ROPE_END                                      3  ~16     ~17, '%0A'
         26        ECHO                                                     ~16
   32    27    > > JMP                                                      ->14
         28    >   FE_FREE                                                  $11
   38    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.44 ms | 1388 KiB | 15 Q