3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (class_exists('DateTimeImmutable')) { $date = new DateTimeImmutable('2015-01-01 00:00:00.123456'); echo serialize($date), PHP_EOL; echo json_encode($date), PHP_EOL; }
based on X7sqZ
Output for 5.5.14 - 7.2.0
O:17:"DateTimeImmutable":3:{s:4:"date";s:26:"2015-01-01 00:00:00.123456";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} {"date":"2015-01-01 00:00:00.123456","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 5.5.0 - 5.5.13
O:17:"DateTimeImmutable":3:{s:4:"date";s:19:"2015-01-01 00:00:00";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} {"date":"2015-01-01 00:00:00","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 4.3.0 - 5.4.45