3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = '{"items": [{"id":"1","food":"rice","Amount":"100","condition":"paid"}, {"id":"2","food":"beans","Amount":"200","condition":"paid"}, {"id":"3","food":"yam","Amount":"50","condition":"not paid"}, {"id":"4","food":"tomatoes","Amount":"100","condition":"paid"}, {"id":"5","food":"potato","Amount":"700","condition":"paid"}]}'; $arr = json_decode($response, true); var_dump($arr); echo $arr['items'][1]['food']; // beans
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiqSo
function name:  (null)
number of ops:  14
compiled vars:  !0 = $response, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22items%22%3A%0A+++++++++%5B%7B%22id%22%3A%221%22%2C%22food%22%3A%22rice%22%2C%22Amount%22%3A%22100%22%2C%22condition%22%3A%22paid%22%7D%2C%0A++++++++++%7B%22id%22%3A%222%22%2C%22food%22%3A%22beans%22%2C%22Amount%22%3A%22200%22%2C%22condition%22%3A%22paid%22%7D%2C%0A++++++++++%7B%22id%22%3A%223%22%2C%22food%22%3A%22yam%22%2C%22Amount%22%3A%2250%22%2C%22condition%22%3A%22not+paid%22%7D%2C%0A++++++++++%7B%22id%22%3A%224%22%2C%22food%22%3A%22tomatoes%22%2C%22Amount%22%3A%22100%22%2C%22condition%22%3A%22paid%22%7D%2C%0A++++++++++%7B%22id%22%3A%225%22%2C%22food%22%3A%22potato%22%2C%22Amount%22%3A%22700%22%2C%22condition%22%3A%22paid%22%7D%5D%7D'
   10     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   11     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   12     9        FETCH_DIM_R                                      ~6      !1, 'items'
         10        FETCH_DIM_R                                      ~7      ~6, 1
         11        FETCH_DIM_R                                      ~8      ~7, 'food'
         12        ECHO                                                     ~8
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.19 ms | 1011 KiB | 15 Q