Bug #67109 [NEW]: First uppercase letter breaks date string parsing

From: Date: Tue, 22 Apr 2014 08:33:36 +0000
Subject: Bug #67109 [NEW]: First uppercase letter breaks date string parsing
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185369@lists.php.net to get a copy of this message
From:             velosipedist dot org at gmail dot com
Operating system: any
PHP version:      5.5.11
Package:          Date/time related
Bug Type:         Bug
Bug description:First uppercase letter breaks date string parsing

Description:
------------
If i make first letter uppercase in date string "last day of this
month", strtotime returns FIRST day.
But same mixed-case string can be parsed correctly in unpredictable
order:\

http://codepad.viper-7.com/MclUwk
http://codepad.viper-7.com/ofbYag

Test script:
---------------
<?php
assert(date('d',strtotime('last day of april')) == "30");
assert(date('d',strtotime('last Day of april')) == "30");
// will raise warning
assert(date('d',strtotime('Last Day of april')) == "30");
	


-- 
Edit bug report at https://bugs.php.net/bug.php?id=67109&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=67109&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=67109&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=67109&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=67109&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=67109&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=67109&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=67109&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=67109&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=67109&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=67109&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=67109&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=67109&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=67109&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67109&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=67109&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=67109&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=67109&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67109&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=67109&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=67109&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#185369) next »