3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = 15, Position 2 = 29
Branch analysis from position: 15
Jump found. Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
Jump found. Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
Jump found. Position 1 = 28
Branch analysis from position: 28
Jump found. Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 23
Jump found. Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 29
Jump found. Position 1 = -2
Branch analysis from position: 29
filename:       /in/DDdJQ
function name:  (null)
number of ops:  31
compiled vars:  !0 = $array, !1 = $jsonIterator, !2 = $val, !3 = $key
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     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      :-5
  29     2        NEW                                              $6      :-3
         3        INIT_FCALL                                               'json_decode'
         4        SEND_VAR                                                 !0
         5        SEND_VAL                                                 <true>
         6        DO_ICALL                                         $7      
         7        SEND_VAR_NO_REF                               4          $7
         8        DO_FCALL                                      0          
         9        SEND_VAR_NO_REF                               0          $6
  30    10        FETCH_CONSTANT                                   ~9      'RecursiveIteratorIterator', 'SELF_FIRST'
        11        SEND_VAL_EX                                              ~9
        12        DO_FCALL                                      0          
        13        ASSIGN                                                   !1, $5
  32    14      > FE_RESET_R                                       $12     !1, ->29
        15    > > FE_FETCH_R                                       ~13     $12, !2, ->29
        16    >   ASSIGN                                                   !3, ~13
  33    17        TYPE_CHECK                                    7  ~15     !2
        18      > JMPZ                                                     ~15, ->23
  34    19    >   NOP                                                      
        20        FAST_CONCAT                                      ~16     !3, '%3A%0A'
        21        ECHO                                                     ~16
        22      > JMP                                                      ->28
  36    23    >   ROPE_INIT                                     4  ~18     !3
        24        ROPE_ADD                                      1  ~18     ~18, '+%3D%3E+'
        25        ROPE_ADD                                      2  ~18     ~18, !2
        26        ROPE_END                                      3  ~17     ~18, '%0A'
        27        ECHO                                                     ~17
        28    > > JMP                                                      ->15
        29    >   FE_FREE                                                  $12
        30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0