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,$amount_2);
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '$amount_2' (T_VARIABLE) in /in/FhvV6 on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/FhvV6 on line 7
Process exited with code 255.

preferences:
187.59 ms | 1395 KiB | 57 Q