Bug #75265 [Opn->Nab]: Returnvalue from strtotime doesn't always return false on errors

From: Date: Wed, 27 Sep 2017 09:03:59 +0000
Subject: Bug #75265 [Opn->Nab]: Returnvalue from strtotime doesn't always return false on errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211380@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75265&edit=1 ID: 75265 Updated by: requinix@php.net Reported by: sven dot kaegi at intellicard dot ch Summary: Returnvalue from strtotime doesn't always return false on errors -Status: Open +Status: Not a bug Type: Bug -Package: Scripting Engine problem +Package: Date/time related Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The second argument is an int so "27.09.2017" was converted to the int 27. Previous Comments: ------------------------------------------------------------------------ [2017-09-27 09:00:18] sven dot kaegi at intellicard dot ch Description: ------------ --- From manual page: http://www.php.net/function.strtotime --- It seems that if you call strtotime with two parameters like this: strtotime("+1 day","27.09.2017"); The return value is a timestamp pointing to the 2nd of January 1970. As I didn't use as a second paramater a valid timestamp this should - according to the documentation - return false instead of a valid timestamp. Test script: --------------- if(strtotime("+1 day","27.09.2017")!==false) { echo "Illegal return value"; } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75265&edit=1

« previous php.bugs (#211380) next »