3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonObject = '{"subtotal":{"amount":"0.50","currency":"USD"}}'; $jsonObject = json_decode(returnJSON); $amount = $jsonObject->{'subtotal'}->{'amount'}; $amount_2 = $jsonObject->subtotal->amount; var_dump($amount); var_dump($amount_2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DNT9L
function name:  (null)
number of ops:  19
compiled vars:  !0 = $jsonObject, !1 = $amount, !2 = $amount_2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%22subtotal%22%3A%7B%22amount%22%3A%220.50%22%2C%22currency%22%3A%22USD%22%7D%7D'
    4     1        INIT_FCALL                                               'json_decode'
          2        FETCH_CONSTANT                                   ~4      'returnJSON'
          3        SEND_VAL                                                 ~4
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !0, $5
    6     6        FETCH_OBJ_R                                      ~7      !0, 'subtotal'
          7        FETCH_OBJ_R                                      ~8      ~7, 'amount'
          8        ASSIGN                                                   !1, ~8
    7     9        FETCH_OBJ_R                                      ~10     !0, 'subtotal'
         10        FETCH_OBJ_R                                      ~11     ~10, 'amount'
         11        ASSIGN                                                   !2, ~11
    9    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   10    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.83 ms | 1395 KiB | 17 Q