Bug #69191 [NEW]: "ordinal week" (not "ordinal weeks") cannot be parsed

From: Date: Thu, 05 Mar 2015 08:56:03 +0000
Subject: Bug #69191 [NEW]: "ordinal week" (not "ordinal weeks") cannot be parsed
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191182@lists.php.net to get a copy of this message
From: ryosuke_i_628 at yahoo dot co dot jp Operating system: PHP version: Irrelevant Package: Date/time related Bug Type: Bug Bug description:"ordinal week" (not "ordinal weeks") cannot be parsed Description: ------------ "ordinal weeks" can be parsed, but "ordinal week" cannot. That seems to be tried to parse as timezone name. Test script: --------------- <?php try { $results['first weeks'] = (new \DateTime('first weeks'))->format('Y-m-d'); $results['first week'] = (new \DateTime('first week'))->format('Y-m-d'); } catch (\Exception $e) { $errors[] = $e->getMessage(); } print_r(compact('results', 'errors')); Expected result: ---------------- Array ( [results] => Array ( [first weeks] => 2015-03-12 [first week] => 2015-03-12 ) ) [Finished in 0.5s] Actual result: -------------- Array ( [results] => Array ( [first weeks] => 2015-03-12 ) [errors] => Array ( [0] => DateTime::__construct(): Failed to parse time string (first week) at position 0 (f): The timezone could not be found in the database ) ) -- Edit bug report at https://bugs.php.net/bug.php?id=69191&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69191&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69191&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69191&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69191&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69191&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69191&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69191&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69191&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69191&r=support Expected behavior: https://bugs.php.net/fix.php?id=69191&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69191&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69191&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69191&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69191&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69191&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69191&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69191&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69191&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69191&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69191&r=mysqlcfg

« previous php.bugs (#191182) next »