3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new \DateTime('2017-12-31 23:59:59.999999'); echo $date->format('Y-m-d H:i:s.u'); echo "\n"; echo $date->modify('+10 microsecond')->format('Y-m-d H:i:s.u');
based on Wl6if
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.26, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
2017-12-31 23:59:59.999999 2018-01-01 00:00:00.000009