3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo json_encode(array( 'home' => array('site/index'), 'contact us' => array('contact/contactUs'), 'article' => array('article/view', array('id' => 15, 'alias' => 'privacy-policy')), 'film' => array('film/view', array('id' => 54, 'alias' => 'film-54-219')), 'top movies' => array('film/top', array('type' => 'movies')), 'top tv shows' => array('film/top', array('type' => 'tv-shows')), 'top documentaries' => array('film/top', array('type' => 'documentaries')), 'movies coming soon' => array('film/comingSoon', array('type' => 'movies')), 'tv shows coming soon' => array('film/comingSoon', array('type' => 'tv-shows')), 'documentaries coming soon' => array('film/comingSoon', array('type' => 'documentaries')), 'top movies dvds' => array('film/dvd', array('type' => 'movies')), 'top tv-shows dvds' => array('film/dvd', array('type' => 'tv-shows')), 'top documentaries dvds' => array('film/dvd', array('type' => 'documentaries')), 'movies box office' => array('film/boxOffice', array('type' => 'movies')), 'tv shows box office' => array('film/boxOffice', array('type' => 'tv-shows')), 'documentaries box office' => array('film/boxOffice', array('type' => 'documentaries')), 'emotions category' => array('search/category', array('category' => 'emotions')), 'time period category' => array('search/category', array('category' => 'time-period')), 'actor' => array('actor/view', array('id' => 923, 'alias' => 'act-923-137')), ), JSON_PRETTY_PRINT);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
{ "home": [ "site\/index" ], "contact us": [ "contact\/contactUs" ], "article": [ "article\/view", { "id": 15, "alias": "privacy-policy" } ], "film": [ "film\/view", { "id": 54, "alias": "film-54-219" } ], "top movies": [ "film\/top", { "type": "movies" } ], "top tv shows": [ "film\/top", { "type": "tv-shows" } ], "top documentaries": [ "film\/top", { "type": "documentaries" } ], "movies coming soon": [ "film\/comingSoon", { "type": "movies" } ], "tv shows coming soon": [ "film\/comingSoon", { "type": "tv-shows" } ], "documentaries coming soon": [ "film\/comingSoon", { "type": "documentaries" } ], "top movies dvds": [ "film\/dvd", { "type": "movies" } ], "top tv-shows dvds": [ "film\/dvd", { "type": "tv-shows" } ], "top documentaries dvds": [ "film\/dvd", { "type": "documentaries" } ], "movies box office": [ "film\/boxOffice", { "type": "movies" } ], "tv shows box office": [ "film\/boxOffice", { "type": "tv-shows" } ], "documentaries box office": [ "film\/boxOffice", { "type": "documentaries" } ], "emotions category": [ "search\/category", { "category": "emotions" } ], "time period category": [ "search\/category", { "category": "time-period" } ], "actor": [ "actor\/view", { "id": 923, "alias": "act-923-137" } ] }
Output for 5.3.0 - 5.3.29
Notice: Use of undefined constant JSON_PRETTY_PRINT - assumed 'JSON_PRETTY_PRINT' in /in/AjU1m on line 29 Warning: json_encode() expects parameter 2 to be long, string given in /in/AjU1m on line 29
Output for 5.2.0 - 5.2.17
Notice: Use of undefined constant JSON_PRETTY_PRINT - assumed 'JSON_PRETTY_PRINT' in /in/AjU1m on line 29 Warning: json_encode() expects exactly 1 parameter, 2 given in /in/AjU1m on line 29
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/AjU1m on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/AjU1m on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/AjU1m on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/AjU1m on line 2