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('+1 microsecond')->format('Y-m-d H:i:s.u');
based on YmDbk
Output for 7.2.12 - 7.2.33, 7.3.0 - 7.3.27, 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.000000
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.11
2017-12-31 23:59:59.999999 2017-12-31 23:59:59.1000000
Output for 7.0.0 - 7.0.33
2017-12-31 23:59:59.999999 Warning: DateTime::modify(): Failed to parse time string (+1 microsecond) at position 9 (e): Double timezone specification in /in/Wl6if on line 7 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/Wl6if:7 Stack trace: #0 {main} thrown in /in/Wl6if on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.40
2017-12-31 23:59:59.999999 Warning: DateTime::modify(): Failed to parse time string (+1 microsecond) at position 9 (e): Double timezone specification in /in/Wl6if on line 7 Fatal error: Call to a member function format() on boolean in /in/Wl6if on line 7
Process exited with code 255.