PHP docs claims that DateTime::modify()
and strtotime()
both should return false
in case of error, but I'm getting this:
> php -r 'var_dump(time(), strtotime("-1 week"), strtotime("-1 wesdek"), (new DateTime())->modify("-1 weeekc"));'
int(1533556632)
int(1532951832)
int(1533560232)
object(DateTime)#1 (3) {
["date"]=>
string(26) "2018-08-06 11:57:12.797259"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
> php -v
PHP 7.2.7 (cli) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
If wesdek
and weeekc
are valid strings, what are they meaning?
P.S. I've seen similar SO question, but here I've shown that obvious methods from there aren't always working…