3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $v2_1 = array( 'lang' => 'en', // based on client's browser user-agent 'location' => array( // based on client's IP 'countryCode' => 'DE', 'countryName' => 'Germany', 'regionName' => 'North-Rhine-Westphalia', 'cityName' => 'Cologne', ), 'headlines' => array( 'Meet Pamela in Cologne today!', 'Start chatting with Pamela from Cologne now!', 'Pamela from Cologne is looking for new friends on meetOne!' ), 'img' => 'http://static.meetone.com/landing/adt/cities/de/koeln.jpg' ); $v2_2 = array( 'lang' => 'de', // based on client's browser user-agent 'location' => array( // based on client's IP 'countryCode' => 'DE', 'countryName' => 'Deutschland', 'regionName' => 'Bayern', 'cityName' => '', ), 'headlines' => array( 'Heute noch Pamela aus Bayern kennenlernen.', 'Lerne noch heute Pamela aus Bayern kennen.', 'Pamela aus Bayern sucht neue Freunde auf meetOne!' ), 'img' => 'http://static.meetone.com/landing/adt/regions/de/bayern.jpg' ); print json_encode($v2_1) . PHP_EOL; print json_encode($v2_2);
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
{"lang":"en","location":{"countryCode":"DE","countryName":"Germany","regionName":"North-Rhine-Westphalia","cityName":"Cologne"},"headlines":["Meet Pamela in Cologne today!","Start chatting with Pamela from Cologne now!","Pamela from Cologne is looking for new friends on meetOne!"],"img":"http:\/\/static.meetone.com\/landing\/adt\/cities\/de\/koeln.jpg"} {"lang":"de","location":{"countryCode":"DE","countryName":"Deutschland","regionName":"Bayern","cityName":""},"headlines":["Heute noch Pamela aus Bayern kennenlernen.","Lerne noch heute Pamela aus Bayern kennen.","Pamela aus Bayern sucht neue Freunde auf meetOne!"],"img":"http:\/\/static.meetone.com\/landing\/adt\/regions\/de\/bayern.jpg"}
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/bKjbf on line 33
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/bKjbf on line 33
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/bKjbf on line 33
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/bKjbf on line 33