3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $invalidDate = '30-02-2015 26:99:99'; $parsedDate = date('30-02-2015'); $parseDateTime = new DateTime($invalidDate); echo $invalidDate . ' ' . $parsedDate . ' ' . $parseDateTime->format('Y-m-d H:i:s') . PHP_EOL;
based on 0K4eu
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (30-02-2015 26:99:99) at position 11 (2): Unexpected character in /in/KNrFL:4 Stack trace: #0 /in/KNrFL(4): DateTime->__construct('30-02-2015 26:9...') #1 {main} thrown in /in/KNrFL on line 4
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (30-02-2015 26:99:99) at position 11 (2): Unexpected character' in /in/KNrFL:4 Stack trace: #0 /in/KNrFL(4): DateTime->__construct('30-02-2015 26:9...') #1 {main} thrown in /in/KNrFL on line 4
Process exited with code 255.