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); var_dump($json_a); 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 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/FoBu3
function name:  (null)
number of ops:  20
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
    9     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   11     9        FETCH_DIM_R                                      ~8      !1, 'menu'
         10      > FE_RESET_R                                       $9      ~8, ->18
         11    > > FE_FETCH_R                                       ~10     $9, !2, ->18
         12    >   ASSIGN                                                   !3, ~10
   12    13        CONCAT                                           ~12     !3, '%3A+'
         14        CONCAT                                           ~13     ~12, !2
         15        CONCAT                                           ~14     ~13, '%3Cbr+%2F%3E'
         16        ECHO                                                     ~14
   11    17      > JMP                                                      ->11
         18    >   FE_FREE                                                  $9
   13    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.29 ms | 1395 KiB | 17 Q