Bug #70245 [Csd]: strtotime does not emit warning when 2nd parameter is object or string.
| From: | cmb@php.net | Date: | Wed, 12 Aug 2015 17:05:40 +0000 |
| Subject: | Bug #70245 [Csd]: strtotime does not emit warning when 2nd parameter is object or string. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195166@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70245&edit=1
ID: 70245
Updated by: cmb@php.net
Reported by: arjen at react dot com
Summary: strtotime does not emit warning when 2nd parameter
is object or string.
Status: Closed
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 7.0.0beta3
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2015-08-12 17:04:24] cmb@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b874086e2e7e85c416d3d698bf1499cfe4eee82
Log: Fix #70245: strtotime does not emit warning when 2nd parameter is object or string
------------------------------------------------------------------------
[2015-08-12 16:02:38] cmb@php.net
That appears to be an accidential side-effect of improving the
implementation of strtotime[1]. Calling zend_parse_parameters()
instead of zend_parse_parameters_ex() would restore the former
behavior.
[1] <https://github.com/php/php-src/commit/6a992e45831fda3e7f5df120660e3fd59a08028a>
------------------------------------------------------------------------
[2015-08-12 12:17:54] arjen at react dot com
Description:
------------
http://3v4l.org/Zuv4a
Test script:
---------------
<?php
$d = new DateTime('2011-01-15 00:00:00');
$foo = strtotime('-1 month', $d);
Expected result:
----------------
Warning: strtotime() expects parameter 2 to be integer, object given in /in/Zuv4a on line 4
Actual result:
--------------
No warning.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70245&edit=1