3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '{"menu": { "title":"Title One", "link":"Link One", "title":"Title Two", "link":"Link Two"} }'; $json_a = json_decode($string,true); foreach($json_a['menu'] as $key => $value) { echo $key . ": " . $value . "<br />"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/2mlBH
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $json_a, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%22menu%22%3A+%7B%0A++++%22title%22%3A%22Title+One%22%2C%0A++++%22link%22%3A%22Link+One%22%2C%0A++++%22title%22%3A%22Title+Two%22%2C%0A++++%22link%22%3A%22Link+Two%22%7D%0A%7D'
    8     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   10     6        FETCH_DIM_R                                      ~7      !1, 'menu'
          7      > FE_RESET_R                                       $8      ~7, ->15
          8    > > FE_FETCH_R                                       ~9      $8, !2, ->15
          9    >   ASSIGN                                                   !3, ~9
   11    10        CONCAT                                           ~11     !3, '%3A+'
         11        CONCAT                                           ~12     ~11, !2
         12        CONCAT                                           ~13     ~12, '%3Cbr+%2F%3E'
         13        ECHO                                                     ~13
   10    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $8
   12    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.3 ms | 1395 KiB | 15 Q