Doc #66789 [NEW]: date() - hasn't warning if pass on second param bool or null type
| From: | e dot romanov88 at gmail dot com | Date: | Thu, 27 Feb 2014 11:32:10 +0000 |
| Subject: | Doc #66789 [NEW]: date() - hasn't warning if pass on second param bool or null type | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-11030@lists.php.net to get a copy of this message | ||
From: e dot romanov88 at gmail dot com
Operating system: SentOS
PHP version: 5.4.25
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:date() - hasn't warning if pass on second param bool or null type
Description:
------------
---
From manual page: http://www.php.net/function.date
---
If a non-numeric value is used for timestamp, FALSE is returned and an
E_WARNING level error is emitted. -
date('Y-m-d H:i:s', null) or date('Y-m-d H:i:s', false) - hasn't
warning, and function return reusult like date('Y-m-d H:i:s', 0);
Test script:
---------------
echo date('Y-m-d H:i:s', null);
Expected result:
----------------
PHP Warning: date() expects parameter 2 to be long, null given.
Actual result:
--------------
"1970-01-01 03:00:00"
--
Edit bug report at https://bugs.php.net/bug.php?id=66789&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66789&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66789&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66789&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66789&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66789&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66789&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66789&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66789&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66789&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66789&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66789&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66789&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66789&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66789&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66789&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66789&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66789&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66789&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66789&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66789&r=mysqlcfg