Bug #69661 [Opn->Ver]: date_parse says the day is 1 instead of false

From: Date: Tue, 19 May 2015 11:54:26 +0000
Subject: Bug #69661 [Opn->Ver]: date_parse says the day is 1 instead of false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192757@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69661&edit=1 ID: 69661 Updated by: cmb@php.net Reported by: php-bugs at xpaw dot me Summary: date_parse says the day is 1 instead of false -Status: Open +Status: Verified Type: Bug Package: Date/time related Operating System: Ubuntu PHP Version: 5.6.9 Block user comment: N Private report: N New Comment: See also <http://3v4l.org/eAiXb>. Previous Comments: ------------------------------------------------------------------------ [2015-05-19 11:17:01] php-bugs at xpaw dot me Description: ------------ I don't know if this is expected behaviour or not, but parsing a date without a day, will produce a result where 'day' will be set to 1. If this is expected, there really should be a parameter that disables this. I'm using this for user provided data, and it's not really valid. Test script: --------------- var_dump(date_parse("May 2013")); Expected result: ---------------- ["day"]=> bool(false) Actual result: -------------- ["day"]=> int(1) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69661&edit=1

« previous php.bugs (#192757) next »