Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39250 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44415 invoked from network); 23 Jul 2008 21:30:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2008 21:30:35 -0000 Received: from [127.0.0.1] ([127.0.0.1:12072]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 40/6B-12534-BF2A7884 for ; Wed, 23 Jul 2008 17:30:35 -0400 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.140 as permitted sender) X-PHP-List-Original-Sender: jack@smartertravelmedia.com X-Host-Fingerprint: 65.112.23.140 relay2.smarterliving.net Linux 2.5 (sometimes 2.4) (4) Received: from [65.112.23.140] ([65.112.23.140:34616] helo=monsoon.smarterliving.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/72-12534-16B87884 for ; Wed, 23 Jul 2008 15:49:53 -0400 Received: from [192.168.1.105] (port=34454 helo=sullivan.smarterliving.com) by monsoon.smarterliving.net (envelope-from ) with esmtp (Exim 4.42) id 1KLkLO-0003l6-Hv for internals@lists.php.net; Wed, 23 Jul 2008 15:49:50 -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: Wed, 23 Jul 2008 15:49:10 -0400 Message-ID: <7AFF263C3DBE2549899F71BB925794FF0492A863@sullivan.smartertravelmedia.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: question about backward-compatibility break/bug in php 5.2.6 Thread-Index: Acjs/E0keTiVXBgTTrajzN0/cIMKJw== To: Subject: question about backward-compatibility break/bug in php 5.2.6 From: jack@smartertravelmedia.com ("Jack Steadman") Hello all, Last week I submitted a bug report on the issue described below. The response (also below) was that this is not a bug. I fail to see how it could *not* be a bug given that strtotime is parsing an invalid date into a seemingly-arbitrary and definitely-meaningless number, rather than returning false as it is supposed to. Can someone explain to me why this is "intended" behavior? We do rely on strtotime returning false on invalid dates, and this behavior changed between 5.2.5 and 5.2.6. Do we need to update our code to check for this arbitrary negative integer? I would prefer not to do that. Thanks, Jack Steadman Smarter Travel Media LLC -------------------------------------------------- Operating system: RHEL 4/5 PHP version: 5.2.6 PHP Bug Type: Date/time related Bug description: strtotime parses 0000-00-00 00:00:00 as valid date Description: ------------ MySQL uses '0000-00-00 00:00:00' as a default value for non-null datetime fields. Until 5.2.6, strtotime correctly returned false (or -1 before 5.1) when passed this value - it's not a valid date/time. 5.2.6 returns '-62169966000' which is not useful. Reproduce code: ---------------