3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row['orders'] = '{"email":"tst@gmail.com","name":"myname","phone":"+123123123"}'; // assoc array $row['country'] = '[{"id":"001","country":"english","code":"123123"}]'; // indexd array containing an assoc array $json_orders = json_decode($row['orders'], true); echo $json_orders['email']; echo "\n---\n"; $json_country = json_decode($row['country'], true); echo $json_country[0]['country'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GpBZQ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $row, !1 = $json_orders, !2 = $json_country
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 'orders'
          1        OP_DATA                                                  '%7B%22email%22%3A%22tst%40gmail.com%22%2C%22name%22%3A%22myname%22%2C%22phone%22%3A%22%2B123123123%22%7D'
    3     2        ASSIGN_DIM                                               !0, 'country'
          3        OP_DATA                                                  '%5B%7B%22id%22%3A%22001%22%2C%22country%22%3A%22english%22%2C%22code%22%3A%22123123%22%7D%5D'
    5     4        INIT_FCALL                                               'json_decode'
          5        FETCH_DIM_R                                      ~5      !0, 'orders'
          6        SEND_VAL                                                 ~5
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
    6    10        FETCH_DIM_R                                      ~8      !1, 'email'
         11        ECHO                                                     ~8
    7    12        ECHO                                                     '%0A---%0A'
    8    13        INIT_FCALL                                               'json_decode'
         14        FETCH_DIM_R                                      ~9      !0, 'country'
         15        SEND_VAL                                                 ~9
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !2, $10
    9    19        FETCH_DIM_R                                      ~12     !2, 0
         20        FETCH_DIM_R                                      ~13     ~12, 'country'
         21        ECHO                                                     ~13
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.33 ms | 1001 KiB | 14 Q