3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = '{ "username":"lon", "event":{ "saved_response":"{\\"parts\\": [{\\"text\\": \\"Passion for teaching means loving your job. Doing with all your heart. Teachers who are passionate can inspire pupils to love learning. Passionate teachers create an effective learning environment and increase learning potential of\\\\nstudents.\\"}]}" }, "event_source":"server" }'; $jarray = json_decode($test, true); $jevent = json_decode( $jarray['event']['saved_response'], true); var_dump($jarray); var_dump($jevent);
Output for 7.1.25 - 7.1.30, 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.27, 8.4.1 - 8.4.14
array(3) { ["username"]=> string(3) "lon" ["event"]=> array(1) { ["saved_response"]=> string(267) "{"parts": [{"text": "Passion for teaching means loving your job. Doing with all your heart. Teachers who are passionate can inspire pupils to love learning. Passionate teachers create an effective learning environment and increase learning potential of\nstudents."}]}" } ["event_source"]=> string(6) "server" } array(1) { ["parts"]=> array(1) { [0]=> array(1) { ["text"]=> string(241) "Passion for teaching means loving your job. Doing with all your heart. Teachers who are passionate can inspire pupils to love learning. Passionate teachers create an effective learning environment and increase learning potential of students." } } }

preferences:
151.21 ms | 410 KiB | 5 Q