3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "@attributes": { "count": "1" }, "receipt": { "@attributes": { "currency": "USD", "rotation": "RT_Clockwise" }, "vendor": { "@attributes": { "confidence": "0.000", "isSuspicious": "true" }, "name": { "recognizedValue": { "text": "SEATTLE" } }, "fullAddress": { "text": {} }, "address": { "text": {} }, "phone": { "@attributes": { "confidence": "70", "isSuspicious": "true" }, "normalizedValue": "2066219777", "recognizedValue": { "text": "206\n621\n9777" } }, "purchaseType": "GasolineStation", "city": { "normalizedValue": "Seattle", "recognizedValue": { "text": "SEATTLE" } }, "zip": { "@attributes": { "confidence": "99", "isSuspicious": "false" }, "normalizedValue": "98134", "recognizedValue": { "text": "98134" } }, "administrativeRegion": { "normalizedValue": "WA", "recognizedValue": { "text": "WA" } } }, "date": { "@attributes": { "confidence": "100", "isSuspicious": "false" }, "normalizedValue": "2020-04-02", "recognizedValue": { "text": "04/02/20" } }, "time": { "@attributes": { "confidence": "100", "isSuspicious": "false" }, "normalizedValue": "14:17:49", "recognizedValue": { "text": "14:17:49" } }, "total": { "@attributes": { "confidence": "34", "isSuspicious": "true" }, "normalizedValue": "150.00", "recognizedValue": { "text": "150\n00" } }, "tax": { "@attributes": { "total": "false" }, "normalizedValue": "0.00", "recognizedValue": { "text": "0.00" } }, "payment": { "@attributes": { "type": "Card", "cardType": "AmericanExpress" }, "value": { "normalizedValue": "150.00", "recognizedValue": { "text": "150\n00" } }, "cardNumber": { "normalizedValue": "XXXXXXXXXXXX2467", "recognizedValue": { "text": "X2467" } } }, "recognizedItems": { "@attributes": { "count": "1" }, "item": { "@attributes": { "index": "1" }, "name": { "@attributes": { "confidence": "0", "isSuspicious": "true" }, "text": "Prepay CA#11" }, "count": { "@attributes": { "confidence": "19", "isSuspicious": "true" }, "normalizedValue": "1.000" }, "total": { "@attributes": { "confidence": "85", "isSuspicious": "false" }, "normalizedValue": "150.00", "recognizedValue": { "text": "150.00" } }, "recognizedText": {}, "amountUnits": "unit" } }, "country": { "@attributes": { "confidence": "100", "isSuspicious": "false" }, "normalizedValue": "USA" }, "recognizedText": {} } }'; $value = json_decode($json)->receipt->total->normalizedValue; var_dump($value);
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
string(6) "150.00"
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
186.58 ms | 407 KiB | 5 Q