3v4l.org

run code in 300+ PHP versions simultaneously
<?php $raw_json = <<< 'JSON' { "fruit": [{ "id": 364823, "name": "Lemon", "amount": [33], "profile": "http://google.com", "buyid": 5 }, { "id": 367851, "name": "Orange", "amount": [69, 95, 166], "profile": "http://google.com", "buyid": 3 },{ "id": 35647, "name": "Apple", "amount": [77, 43], "profile": "http://google.com", "buyid": 31 } ] } JSON; $json = json_decode($raw_json, true); foreach($json['fruit'] as $fruit){ echo implode(' ',$fruit['amount'])."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/emvgE
function name:  (null)
number of ops:  19
compiled vars:  !0 = $raw_json, !1 = $json, !2 = $fruit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A++++%22fruit%22%3A+%5B%7B%0A++++++++%22id%22%3A+364823%2C%0A++++++++%22name%22%3A+%22Lemon%22%2C%0A++++++++%22amount%22%3A+%5B33%5D%2C%0A++++++++%22profile%22%3A+%22http%3A%2F%2Fgoogle.com%22%2C%0A++++++++%22buyid%22%3A+5%0A++++%7D%2C+%7B%0A++++++++%22id%22%3A+367851%2C%0A++++++++%22name%22%3A+%22Orange%22%2C%0A++++++++%22amount%22%3A+%5B69%2C+95%2C+166%5D%2C%0A++++++++%22profile%22%3A+%22http%3A%2F%2Fgoogle.com%22%2C%0A++++++++%22buyid%22%3A+3%0A++++%7D%2C%7B%0A++++++++%22id%22%3A+35647%2C%0A++++++++%22name%22%3A+%22Apple%22%2C%0A++++++++%22amount%22%3A+%5B77%2C+43%5D%2C%0A++++++++%22profile%22%3A+%22http%3A%2F%2Fgoogle.com%22%2C%0A++++++++%22buyid%22%3A+31%0A++++%7D+%5D%0A%7D'
   25     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   28     6        FETCH_DIM_R                                      ~6      !1, 'fruit'
          7      > FE_RESET_R                                       $7      ~6, ->17
          8    > > FE_FETCH_R                                               $7, !2, ->17
   29     9    >   INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '+'
         11        FETCH_DIM_R                                      ~8      !2, 'amount'
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                         $9      
         14        CONCAT                                           ~10     $9, '%0A'
         15        ECHO                                                     ~10
   28    16      > JMP                                                      ->8
         17    >   FE_FREE                                                  $7
   30    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.64 ms | 1395 KiB | 17 Q