3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_string = <<<'EOT' { "John": { "status":"Wait" }, "Jennifer": { "status":"Active" }, "James": { "status":"Active", "age":56, "count":10, "progress":0.0029857, "bad":0 } } EOT; //$json_string = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; $json = json_decode($json_string); //var_dump($json); foreach ($json as $key => $val) { if(is_array($val)) { echo "$key:\n"; } else { $json2 = json_decode($val); foreach ($json2 as $key2 => $val2) { if(is_array($val2)) { echo "$key2:\n"; } else { echo "$key2 => $val2\n"; } } //var_dump($key); //var_dump($val); //echo "$key => $val\n"; } } //echo $json;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 35
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 35
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 33
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 33
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 33
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/VbLr8
function name:  (null)
number of ops:  37
compiled vars:  !0 = $json_string, !1 = $json, !2 = $val, !3 = $key, !4 = $json2, !5 = $val2, !6 = $key2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '++++%7B%0A++++%09%22John%22%3A+%7B%0A+++++%09+++%22status%22%3A%22Wait%22%0A++++%09%7D%2C%0A++++%09%22Jennifer%22%3A+%7B%0A++++%09++++%22status%22%3A%22Active%22%0A++++%09%7D%2C%0A++++%09%22James%22%3A+%7B%0A+++++%09+++%22status%22%3A%22Active%22%2C%0A++++++++%09%22age%22%3A56%2C%0A++++++++%09%22count%22%3A10%2C%0A++++++++%09%22progress%22%3A0.0029857%2C%0A++++++++%09%22bad%22%3A0%0A+++%09%09%7D%0A%09%7D'
   23     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $8      
          4        ASSIGN                                                   !1, $8
   27     5      > FE_RESET_R                                       $10     !1, ->35
          6    > > FE_FETCH_R                                       ~11     $10, !2, ->35
          7    >   ASSIGN                                                   !3, ~11
   28     8        TYPE_CHECK                                  128          !2
          9      > JMPZ                                                     ~13, ->14
   29    10    >   NOP                                                      
         11        FAST_CONCAT                                      ~14     !3, '%3A%0A'
         12        ECHO                                                     ~14
         13      > JMP                                                      ->34
   31    14    >   INIT_FCALL                                               'json_decode'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !4, $15
   33    18      > FE_RESET_R                                       $17     !4, ->33
         19    > > FE_FETCH_R                                       ~18     $17, !5, ->33
         20    >   ASSIGN                                                   !6, ~18
   34    21        TYPE_CHECK                                  128          !5
         22      > JMPZ                                                     ~20, ->27
   35    23    >   NOP                                                      
         24        FAST_CONCAT                                      ~21     !6, '%3A%0A'
         25        ECHO                                                     ~21
         26      > JMP                                                      ->32
   37    27    >   ROPE_INIT                                     4  ~23     !6
         28        ROPE_ADD                                      1  ~23     ~23, '+%3D%3E+'
         29        ROPE_ADD                                      2  ~23     ~23, !5
         30        ROPE_END                                      3  ~22     ~23, '%0A'
         31        ECHO                                                     ~22
   33    32    > > JMP                                                      ->19
         33    >   FE_FREE                                                  $17
   27    34    > > JMP                                                      ->6
         35    >   FE_FREE                                                  $10
   46    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.64 ms | 1400 KiB | 15 Q