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 EOL; echo $date->modify('+1 microsecond')->format('Y-m-d H:i:s.u');
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
2017-12-31 23:59:59.999999 Fatal error: Uncaught Error: Undefined constant "EOL" in /in/YmDbk:6 Stack trace: #0 {main} thrown in /in/YmDbk on line 6
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
2017-12-31 23:59:59.999999 Warning: Use of undefined constant EOL - assumed 'EOL' (this will throw an Error in a future version of PHP) in /in/YmDbk on line 6 EOL2018-01-01 00:00:00.000000
Output for 7.2.0 - 7.2.6
2017-12-31 23:59:59.999999 Warning: Use of undefined constant EOL - assumed 'EOL' (this will throw an Error in a future version of PHP) in /in/YmDbk on line 6 EOL2017-12-31 23:59:59.1000000
Output for 7.1.0 - 7.1.20
2017-12-31 23:59:59.999999 Notice: Use of undefined constant EOL - assumed 'EOL' in /in/YmDbk on line 6 EOL2017-12-31 23:59:59.1000000

preferences:
142.16 ms | 401 KiB | 152 Q