Bug #76218 [NEW]: Format DATE_RFC3339_EXTENDED fails to match valid input

From: Date: Fri, 13 Apr 2018 14:02:35 +0000
Subject: Bug #76218 [NEW]: Format DATE_RFC3339_EXTENDED fails to match valid input
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214730@lists.php.net to get a copy of this message
From: giacomo dot pinato at gmail dot com Operating system: MacOS PHP version: 7.2.4 Package: Date/time related Bug Type: Bug Bug description:Format DATE_RFC3339_EXTENDED fails to match valid input Description: ------------ The DateTime class fails to correctly instantiate with the DATE_RFC3339_EXTENDED when input data is correct. The example in this bug is taken directly from the documentation at http://php.net/manual/en/class.datetime.php Test script: --------------- <?php $willBeFalse = DateTime::createFromFormat(DATE_RFC3339_EXTENDED, '2005-08-15T15:52:01.000+00:00'); $willAlsoBeFalse = DateTimeImmutable::createFromFormat(DATE_RFC3339_EXTENDED, '2005-08-15T15:52:01.000+00:00'); $date = new DateTime(); $shouldNotBeFalse = DateTime::createFromFormat(DATE_RFC3339_EXTENDED, $date->format(DATE_RFC3339_EXTENDED)); var_dump($shouldNotBeFalse); // false Expected result: ---------------- The two objects should get instantiated correctly Actual result: -------------- $willBeFalse and $willAlsoBeFalse are false -- Edit bug report at https://bugs.php.net/bug.php?id=76218&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76218&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76218&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76218&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76218&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76218&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76218&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76218&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76218&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76218&r=support Expected behavior: https://bugs.php.net/fix.php?id=76218&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76218&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76218&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76218&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76218&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76218&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76218&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76218&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76218&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76218&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76218&r=mysqlcfg

« previous php.bugs (#214730) next »