Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20021 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59759 invoked by uid 1010); 15 Nov 2005 17:35:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59744 invoked from network); 15 Nov 2005 17:35:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2005 17:35:39 -0000 X-Host-Fingerprint: 195.197.172.116 gw02.mail.saunalahti.fi Linux 2.4/2.6 Received: from ([195.197.172.116:39029] helo=gw02.mail.saunalahti.fi) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 0B/C6-07637-A6C1A734 for ; Tue, 15 Nov 2005 12:35:39 -0500 Received: from nest.netphobia.fi (YZDCXXXI.dsl.saunalahti.fi [85.76.35.232]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 51DDFD6908; Tue, 15 Nov 2005 19:35:33 +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 jAFHZZwD029423; Tue, 15 Nov 2005 19:35:35 +0200 Received: from localhost (jani@localhost) by nest.netphobia.fi (8.13.1/8.13.1/Submit) with ESMTP id jAFHZZj6029420; Tue, 15 Nov 2005 19:35:35 +0200 X-Authentication-Warning: nest.netphobia.fi: jani owned process doing -bs Date: Tue, 15 Nov 2005 19:35:35 +0200 (EET) Reply-To: Jani Taskinen To: Rasmus Lerdorf cc: internals@lists.php.net In-Reply-To: <437A1BD1.9030309@lerdorf.com> Message-ID: References: <437A0D24.6030701@caedmon.net> <20051115181307.18c2b27b@localhost.localdomain> <437A1820.8060902@lerdorf.com> <437A1BD1.9030309@lerdorf.com> 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) On Tue, 15 Nov 2005, Rasmus Lerdorf wrote: > > Jani Taskinen wrote: >> On Tue, 15 Nov 2005, Rasmus Lerdorf wrote: >> >>> >>> Pierre wrote: >>>> On Tue, 15 Nov 2005 18:59:32 +0200 (EET) >>>> sniper@iki.fi (Jani Taskinen) wrote: >>>> >>>>> 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..) >>>> >>>> PHP is losely typed, I see nothing wrong to pass an integer as string >>>> there (for example, imagecreate("100", "100"); works). >>> >>> The question isn't what to do with "100","100" but what to do with >>> "100abc","100abc". Should that still work? The old zend_get_parameters() >>> following by a convert_to_long() says Yes. The newer >>> zend_parse_parameters() says no. >> >> With new version it's possible to catch such typos, with old one they'd >> just be silently ignored and perhaps could cause very hard to find bugs >> in your code.. > > I suppose, but I still find it weird that: > > date("h", (int)$foo); > > and > > date("h", $foo); > > will behave differently when $foo isn't a clean numeric string. And when we > move 100% to zend_parse_parameters() in PHP 6 there will be many more > functions changing their behaviour due to this. I bet this isn't only thing that's changing. But you really can't get an omelette without breaking some eggs, can you? :) --Jani