Logical reason for strtotime('east') and strtotime('west') returning valid results?

From: Date: Mon, 05 Apr 2010 17:39:55 +0000
Subject: Logical reason for strtotime('east') and strtotime('west') returning valid results?
Groups: php.general 
Request: Send a blank email to php-general+get-303839@lists.php.net to get a copy of this message
Hi, Long time no speak! As part of a quick filter I'm writing I try to interpret free text strings as dates and textual data. Sometimes, this goes wrong. For example, I discovered that some words (or strings beginning with those words) will return false positives: e.g.: [colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("east"));' int(1270514111) [colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("west"));' int(1270488914) [colin@jimmy Search (working)]$ php -r 'var_dump(strtotime("now"));' int(1270488928) The last one is valid! But the other two appear to do much the same thing... Can anyone think of why this would be valid results before I report this to the relevant authorities? Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/]

« previous php.general (#303839) next »