Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39275 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82099 invoked from network); 24 Jul 2008 15:31:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2008 15:31:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=jack@smartertravelmedia.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jack@smartertravelmedia.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain smartertravelmedia.com designates 65.112.23.142 as permitted sender) X-PHP-List-Original-Sender: jack@smartertravelmedia.com X-Host-Fingerprint: 65.112.23.142 relay1.smarterliving.net Linux 2.4/2.6 Received: from [65.112.23.142] ([65.112.23.142:45330] helo=typhoon.smarterliving.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E8/39-44225-A60A8884 for ; Thu, 24 Jul 2008 11:31:55 -0400 Received: from [192.168.1.105] (port=2448 helo=sullivan.smarterliving.com) by typhoon.smarterliving.net (envelope-from ) with esmtp (Exim 4.60) id 1KM2n9-0001Jv-Lr; Thu, 24 Jul 2008 11:31:47 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 24 Jul 2008 11:30:57 -0400 Message-ID: <7AFF263C3DBE2549899F71BB925794FF0492A872@sullivan.smartertravelmedia.com> In-Reply-To: <96d7f8680807240822o489292dbyc8a9b45de95acf63@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] question about backward-compatibility break/bug in php 5.2.6 Thread-Index: AcjtoREDrB/sm15jS4etYnPdSgOILQAADSHA References: <7AFF263C3DBE2549899F71BB925794FF0492A863@sullivan.smartertravelmedia.com> <48884251.1020300@gmx.net> <7AFF263C3DBE2549899F71BB925794FF0492A865@sullivan.smartertravelmedia.com> <4888931D.6080405@gmx.net> <7AFF263C3DBE2549899F71BB925794FF0492A86F@sullivan.smartertravelmedia.com> <96d7f8680807240822o489292dbyc8a9b45de95acf63@mail.gmail.com> To: "Zach Shepherd" Cc: "Christian Seiler" , Subject: RE: [PHP-DEV] question about backward-compatibility break/bug in php 5.2.6 From: jack@smartertravelmedia.com ("Jack Steadman") > I'm not sure that there's any problem with the documentation=20 > (although it wouldn't hurt to mention it in the comments).=20 > What is it about "0000-00-00 00:00:00" that makes it an=20 > invalid date? (See Christian's explanation) Zero values for month and day are NOT valid. PHP treats them as valid, but according to GNU (on whose requirements strtotime's parsing is based, according to the docs), month values must be in the range of 1-12 and day values must be 1-31. Come to think of it, I wonder how PHP handles something like '2008-06-31' - does it treat that as July 1? Or does it call it an invalid date? Seems like the same sort of behavior - should be considered invalid, but I'm betting that PHP handles it transparently. The upshot is that we can't actually rely on strtotime to determine whether a string is a valid date/time. The docs don't ever explicitly say that the date strings themselves are checked for validity, but returning false on "failure" implies to me that it will return false if it can't get a *valid* date out of the string. Jack