note 34367 added to function.strtotime

From: Date: Fri, 25 Jul 2003 02:14:27 +0000
Subject: note 34367 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-52597@lists.php.net to get a copy of this message
Re Tim Fountain's note on 0 vs -1 return: the suggestion that "both values would be the same" is not strictly true, as 0 !== false (checking for boolean type match). Compare this with the return for strpos() where a return of 0 means "match found at the first character", but a return of false (boolean) means "no match found". The difference in these return values (false vs -1) seems to be an inconsistency in PHP's behaviour to me - why then doesn't strtotime return false, or strpos return -1, on failure? Maybe there's a good reason for this - feel free to clarify/argue... ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34367 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34367&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34367&report=yes

« previous php.notes (#52597) next »