3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"1455260079":"Tracking : #34567808765098767 USPS","1455260723":"Delivered","1455261541":"Received Back"}'; $json_array = json_decode($json, true); var_dump($json_array); print_r($json_array); echo $json_array["1455260079"]."\n"; $json_obj = json_decode($json); $json_array = (array) $json_obj; var_dump($json_array); print_r($json_array); echo $json_array["1455260079"]."\n";
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.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.29, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.2
array(3) { [1455260079]=> string(34) "Tracking : #34567808765098767 USPS" [1455260723]=> string(9) "Delivered" [1455261541]=> string(13) "Received Back" } Array ( [1455260079] => Tracking : #34567808765098767 USPS [1455260723] => Delivered [1455261541] => Received Back ) Tracking : #34567808765098767 USPS array(3) { [1455260079]=> string(34) "Tracking : #34567808765098767 USPS" [1455260723]=> string(9) "Delivered" [1455261541]=> string(13) "Received Back" } Array ( [1455260079] => Tracking : #34567808765098767 USPS [1455260723] => Delivered [1455261541] => Received Back ) Tracking : #34567808765098767 USPS
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.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
array(3) { [1455260079]=> string(34) "Tracking : #34567808765098767 USPS" [1455260723]=> string(9) "Delivered" [1455261541]=> string(13) "Received Back" } Array ( [1455260079] => Tracking : #34567808765098767 USPS [1455260723] => Delivered [1455261541] => Received Back ) Tracking : #34567808765098767 USPS array(3) { ["1455260079"]=> string(34) "Tracking : #34567808765098767 USPS" ["1455260723"]=> string(9) "Delivered" ["1455261541"]=> string(13) "Received Back" } Array ( [1455260079] => Tracking : #34567808765098767 USPS [1455260723] => Delivered [1455261541] => Received Back ) Notice: Undefined offset: 1455260079 in /in/PULrp on line 14

preferences:
150.18 ms | 412 KiB | 5 Q