3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array_map(function ($a) { return json_encode($a); }, [ 'a' => 'b', 'c' => ['a' => 'b', 'c' => new DateTimeImmutable()], ]); var_dump($a);
Output for 7.2.0
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.003986","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 7.1.10
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.003172","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 7.1.7
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.002471","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 7.1.6
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.013081","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 7.1.5
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.012558","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 7.1.0
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.004053","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 5.6.28, 7.0.20
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:08.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 5.5.14 - 5.6.24, 7.0.0 - 7.0.9
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:00:38.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }
Output for 5.5.0 - 5.5.13
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(93) "{"a":"b","c":{"date":"2015-11-19 18:00:38","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }