3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "area_metadata": [ { "name": "Ang Mo Kio", "label_location": { "latitude": 1.375, "longitude": 103.839 } }, { "name": "Bedok", "label_location": { "latitude": 1.321, "longitude": 103.924 } }, { "name": "Bishan", "label_location": { "latitude": 1.350772, "longitude": 103.839 } }, { "name": "Boon Lay", "label_location": { "latitude": 1.304, "longitude": 103.701 } }, { "name": "Bukit Batok", "label_location": { "latitude": 1.353, "longitude": 103.754 } }, { "name": "Bukit Merah", "label_location": { "latitude": 1.277, "longitude": 103.819 } }, { "name": "Bukit Panjang", "label_location": { "latitude": 1.362, "longitude": 103.77195 } }, { "name": "Bukit Timah", "label_location": { "latitude": 1.325, "longitude": 103.791 } }, { "name": "Central Water Catchment", "label_location": { "latitude": 1.38, "longitude": 103.805 } }, { "name": "Changi", "label_location": { "latitude": 1.357, "longitude": 103.987 } }, { "name": "Choa Chu Kang", "label_location": { "latitude": 1.377, "longitude": 103.745 } }, { "name": "Clementi", "label_location": { "latitude": 1.315, "longitude": 103.76 } }, { "name": "City", "label_location": { "latitude": 1.292, "longitude": 103.844 } }, { "name": "Geylang", "label_location": { "latitude": 1.318, "longitude": 103.884 } }, { "name": "Hougang", "label_location": { "latitude": 1.361218, "longitude": 103.886 } }, { "name": "Jalan Bahar", "label_location": { "latitude": 1.347, "longitude": 103.67 } }, { "name": "Jurong East", "label_location": { "latitude": 1.326, "longitude": 103.737 } }, { "name": "Jurong Island", "label_location": { "latitude": 1.266, "longitude": 103.699 } }, { "name": "Jurong West", "label_location": { "latitude": 1.34039, "longitude": 103.705 } }, { "name": "Kallang", "label_location": { "latitude": 1.312, "longitude": 103.862 } }, { "name": "Lim Chu Kang", "label_location": { "latitude": 1.423, "longitude": 103.717332 } }, { "name": "Mandai", "label_location": { "latitude": 1.419, "longitude": 103.812 } }, { "name": "Marine Parade", "label_location": { "latitude": 1.297, "longitude": 103.891 } }, { "name": "Novena", "label_location": { "latitude": 1.327, "longitude": 103.826 } }, { "name": "Pasir Ris", "label_location": { "latitude": 1.37, "longitude": 103.948 } }, { "name": "Paya Lebar", "label_location": { "latitude": 1.358, "longitude": 103.914 } }, { "name": "Pioneer", "label_location": { "latitude": 1.315, "longitude": 103.675 } }, { "name": "Pulau Tekong", "label_location": { "latitude": 1.403, "longitude": 104.053 } }, { "name": "Pulau Ubin", "label_location": { "latitude": 1.404, "longitude": 103.96 } }, { "name": "Punggol", "label_location": { "latitude": 1.401, "longitude": 103.904 } }, { "name": "Queenstown", "label_location": { "latitude": 1.291, "longitude": 103.78576 } }, { "name": "Seletar", "label_location": { "latitude": 1.404, "longitude": 103.869 } }, { "name": "Sembawang", "label_location": { "latitude": 1.445, "longitude": 103.818495 } }, { "name": "Sengkang", "label_location": { "latitude": 1.384, "longitude": 103.891443 } }, { "name": "Sentosa", "label_location": { "latitude": 1.243, "longitude": 103.832 } }, { "name": "Serangoon", "label_location": { "latitude": 1.357, "longitude": 103.865 } }, { "name": "Southern Islands", "label_location": { "latitude": 1.208, "longitude": 103.842 } }, { "name": "Sungei Kadut", "label_location": { "latitude": 1.413, "longitude": 103.756 } }, { "name": "Tampines", "label_location": { "latitude": 1.345, "longitude": 103.944 } }, { "name": "Tanglin", "label_location": { "latitude": 1.308, "longitude": 103.813 } }, { "name": "Tengah", "label_location": { "latitude": 1.374, "longitude": 103.715 } }, { "name": "Toa Payoh", "label_location": { "latitude": 1.334304, "longitude": 103.856327 } }, { "name": "Tuas", "label_location": { "latitude": 1.294947, "longitude": 103.635 } }, { "name": "Western Islands", "label_location": { "latitude": 1.205926, "longitude": 103.746 } }, { "name": "Western Water Catchment", "label_location": { "latitude": 1.405, "longitude": 103.689 } }, { "name": "Woodlands", "label_location": { "latitude": 1.432, "longitude": 103.786528 } }, { "name": "Yishun", "label_location": { "latitude": 1.418, "longitude": 103.839 } } ], "items": [ { "update_timestamp": "2017-05-02T09:21:18+08:00", "timestamp": "2017-05-02T09:07:00+08:00", "valid_period": { "start": "2017-05-02T09:00:00+08:00", "end": "2017-05-02T11:00:00+08:00" }, "forecasts": [ { "area": "Ang Mo Kio", "forecast": "Partly Cloudy (Day)" }, { "area": "Bedok", "forecast": "Partly Cloudy (Day)" }, { "area": "Bishan", "forecast": "Partly Cloudy (Day)" }, { "area": "Boon Lay", "forecast": "Thundery Showers" }, { "area": "Bukit Batok", "forecast": "Light Showers" }, { "area": "Bukit Merah", "forecast": "Showers" }, { "area": "Bukit Panjang", "forecast": "Partly Cloudy (Day)" }, { "area": "Bukit Timah", "forecast": "Light Showers" }, { "area": "Central Water Catchment", "forecast": "Partly Cloudy (Day)" }, { "area": "Changi", "forecast": "Partly Cloudy (Day)" }, { "area": "Choa Chu Kang", "forecast": "Light Showers" }, { "area": "Clementi", "forecast": "Thundery Showers" }, { "area": "City", "forecast": "Partly Cloudy (Day)" }, { "area": "Geylang", "forecast": "Partly Cloudy (Day)" }, { "area": "Hougang", "forecast": "Partly Cloudy (Day)" }, { "area": "Jalan Bahar", "forecast": "Thundery Showers" }, { "area": "Jurong East", "forecast": "Thundery Showers" }, { "area": "Jurong Island", "forecast": "Thundery Showers" }, { "area": "Jurong West", "forecast": "Thundery Showers" }, { "area": "Kallang", "forecast": "Partly Cloudy (Day)" }, { "area": "Lim Chu Kang", "forecast": "Partly Cloudy (Day)" }, { "area": "Mandai", "forecast": "Partly Cloudy (Day)" }, { "area": "Marine Parade", "forecast": "Partly Cloudy (Day)" }, { "area": "Novena", "forecast": "Partly Cloudy (Day)" }, { "area": "Pasir Ris", "forecast": "Partly Cloudy (Day)" }, { "area": "Paya Lebar", "forecast": "Partly Cloudy (Day)" }, { "area": "Pioneer", "forecast": "Thundery Showers" }, { "area": "Pulau Tekong", "forecast": "Partly Cloudy (Day)" }, { "area": "Pulau Ubin", "forecast": "Partly Cloudy (Day)" }, { "area": "Punggol", "forecast": "Partly Cloudy (Day)" }, { "area": "Queenstown", "forecast": "Thundery Showers" }, { "area": "Seletar", "forecast": "Partly Cloudy (Day)" }, { "area": "Sembawang", "forecast": "Partly Cloudy (Day)" }, { "area": "Sengkang", "forecast": "Partly Cloudy (Day)" }, { "area": "Sentosa", "forecast": "Showers" }, { "area": "Serangoon", "forecast": "Partly Cloudy (Day)" }, { "area": "Southern Islands", "forecast": "Showers" }, { "area": "Sungei Kadut", "forecast": "Partly Cloudy (Day)" }, { "area": "Tampines", "forecast": "Partly Cloudy (Day)" }, { "area": "Tanglin", "forecast": "Partly Cloudy (Day)" }, { "area": "Tengah", "forecast": "Showers" }, { "area": "Toa Payoh", "forecast": "Partly Cloudy (Day)" }, { "area": "Tuas", "forecast": "Thundery Showers" }, { "area": "Western Islands", "forecast": "Thundery Showers" }, { "area": "Western Water Catchment", "forecast": "Showers" }, { "area": "Woodlands", "forecast": "Partly Cloudy (Day)" }, { "area": "Yishun", "forecast": "Partly Cloudy (Day)" } ] } ], "api_info": { "status": "healthy" } }'; $data = json_decode($json); echo $data->items[0]->forecasts[0]->area; ?>
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 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.27, 8.4.1 - 8.4.14
Ang Mo Kio
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/c4VZA on line 539
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/c4VZA on line 539
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/c4VZA on line 539
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/c4VZA on line 539

preferences:
169.33 ms | 409 KiB | 5 Q