Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20008 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17887 invoked by uid 1010); 15 Nov 2005 16:59:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 17872 invoked from network); 15 Nov 2005 16:59:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2005 16:59:36 -0000 X-Host-Fingerprint: 195.197.172.116 gw02.mail.saunalahti.fi Linux 2.4/2.6 Received: from ([195.197.172.116:35064] helo=gw02.mail.saunalahti.fi) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6C/00-07637-8F31A734 for ; Tue, 15 Nov 2005 11:59:36 -0500 Received: from nest.netphobia.fi (YZDCXXXI.dsl.saunalahti.fi [85.76.35.232]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 268EFD768B; Tue, 15 Nov 2005 18:59:30 +0200 (EET) Received: from nest.netphobia.fi (nest.netphobia.fi [127.0.0.1]) by nest.netphobia.fi (8.13.1/8.13.1) with ESMTP id jAFGxX0K026124; Tue, 15 Nov 2005 18:59:33 +0200 Received: from localhost (jani@localhost) by nest.netphobia.fi (8.13.1/8.13.1/Submit) with ESMTP id jAFGxW9P026121; Tue, 15 Nov 2005 18:59:32 +0200 X-Authentication-Warning: nest.netphobia.fi: jani owned process doing -bs Date: Tue, 15 Nov 2005 18:59:32 +0200 (EET) Reply-To: Jani Taskinen To: Sean Coates cc: internals In-Reply-To: <437A0D24.6030701@caedmon.net> Message-ID: References: <437A0D24.6030701@caedmon.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [PHP-DEV] date() behaviour changed in 5.1? From: sniper@iki.fi (Jani Taskinen) If you pass bad data to a function, it should not warn you? I'd rather have it as a FATAL error. :) Nothing to fix here, move along. (and fix your code..) --Jani On Tue, 15 Nov 2005, Sean Coates wrote: > > I discussed this with Rasmus and Derick, yesterday, but I don't think we > came to a conclusion.. > > Is this a bug, or intended behaviour? > > sean@iconoclast:~$ /opt/src/php-5.0.4/sapi/cli/php -r 'echo date("r", > "1132003418 ") ."\n";' > Mon, 14 Nov 2005 16:23:38 -0500 > sean@iconoclast:~$ /opt/src/php5-200511131530/sapi/cli/php -r 'echo > date("r", "1132003418 ") ."\n";' > > Warning: date() expects parameter 2 to be long, string given in Command > line code on line 1 > > sean@iconoclast:~$ > > The conclusion SEEMED to be that it's a bug in the parameter parsing API > (as date() now uses the new API). > > I think that the 2nd param should automatically be cast to an int. Yes, > I realize that the documentation says it should be an int, and I'm ok > with that (the extraneous whitespace is my fault). I think it should be > mentioned in the release docs if it won't be fixed, though. > > Also, a warning is pretty harsh. A E_NOTICE is more representative of > what's happening. Also, in the E_WARNING scenario above, date() no > longer returns the expected result (based on <=5.0 code). > > So: is this a bug? If so, I can send a report -- I just didn't want it > to get bogussed without discussion. > > If not -- I really think this should be fixed before 5.1.. I realize > it's very late in the game, though. > > Opinions? > > S > >