Bug #70245 [Ana->Csd]: strtotime does not emit warning when 2nd parameter is object or string.

From: Date: Wed, 12 Aug 2015 17:04:26 +0000
Subject: Bug #70245 [Ana->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-195165@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: Analyzed +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: 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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#195165) next »