3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $b = array_map(function ($a) { return json_encode($a); }, [ 'a' => 'b', 'c' => ['a' => 'b', 'c' => new DateTimeImmutable()], ]); var_dump($b);
Output for 7.2.0
array(2) { ["a"]=> string(3) ""b"" ["c"]=> string(100) "{"a":"b","c":{"date":"2015-11-19 18:01:24.003029","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:24.003807","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:24.002455","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:24.011930","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:24.011404","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:24.004043","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:24.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:01:23.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:01:23","timezone_type":3,"timezone":"Europe\/Amsterdam"}}" }