3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<'JSON' { "query": [ "and for tomorrow" ], "contexts": "[{'name':'weather', 'lifespan' : 4}]", "location": { "latitude": 37.459157, "longitude": -122.17926 }, "timezone": "America/New_York", "lang": "en", "sessionId": "1234567890" } JSON; $data = json_decode($json, true); var_dump($data);
Output for 5.6.0 - 5.6.26, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
array(6) { ["query"]=> array(1) { [0]=> string(16) "and for tomorrow" } ["contexts"]=> string(36) "[{'name':'weather', 'lifespan' : 4}]" ["location"]=> array(2) { ["latitude"]=> float(37.459157) ["longitude"]=> float(-122.17926) } ["timezone"]=> string(16) "America/New_York" ["lang"]=> string(2) "en" ["sessionId"]=> string(10) "1234567890" }

preferences:
154.88 ms | 404 KiB | 202 Q