Bug #75249 [NEW]: datetime constructor does not throws exception on invalida date

From: Date: Sat, 23 Sep 2017 14:21:01 +0000
Subject: Bug #75249 [NEW]: datetime constructor does not throws exception on invalida date
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211330@lists.php.net to get a copy of this message
From: contatto at developiu dot it Operating system: linux PHP version: 7.1.9 Package: Date/time related Bug Type: Bug Bug description:datetime constructor does not throws exception on invalida date Description: ------------ In the ducumentation it is stated that from php 5.3 if time contains an invalid date/time format, then an exception is now thrown. Previously an error was emitted. This does not happen always, as the code below shows. No exception is thrown and the date object is the first of march. Note: I'm using php from remi repositories and php --version shows version 7.1.7 which is not an available options in the select before. Test script: --------------- $d=new DateTime("2017-02-29"); var_dump($d); -- Edit bug report at https://bugs.php.net/bug.php?id=75249&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75249&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75249&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75249&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75249&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75249&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75249&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75249&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75249&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75249&r=support Expected behavior: https://bugs.php.net/fix.php?id=75249&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75249&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75249&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75249&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75249&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75249&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75249&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75249&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75249&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75249&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75249&r=mysqlcfg

« previous php.bugs (#211330) next »