Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20023 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74074 invoked by uid 1010); 15 Nov 2005 17:42:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74059 invoked from network); 15 Nov 2005 17:42:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2005 17:42:42 -0000 X-Host-Fingerprint: 64.233.184.193 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.193:14037] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 56/59-07637-21E1A734 for ; Tue, 15 Nov 2005 12:42:42 -0500 Received: by wproxy.gmail.com with SMTP id i24so1287964wra for ; Tue, 15 Nov 2005 09:42:38 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=j4jutFPKVloHJd7pX0HfdKLMK+rWDyRLf2EM2C+N6VQNnPXjaMKRLoZ6Qsen1xhEc+S+pJOfD13FS6ufgsdNkJOdbWcRx5KzlRVCab/x406AMU4hnfTqAcCweo64j0j1MN+n8MPI43dX69JeZ8r1Q2oh6+hNB8yHmujpEQDOwW0= Received: by 10.54.107.4 with SMTP id f4mr5085461wrc; Tue, 15 Nov 2005 09:42:37 -0800 (PST) Received: by 10.54.76.6 with HTTP; Tue, 15 Nov 2005 09:42:37 -0800 (PST) Message-ID: <4e89b4260511150942g6f3cab3boad1c09eb1c1e7318@mail.gmail.com> Date: Tue, 15 Nov 2005 12:42:37 -0500 To: Rasmus Lerdorf Cc: Jani Taskinen , internals@lists.php.net In-Reply-To: <437A1BD1.9030309@lerdorf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <437A0D24.6030701@caedmon.net> <20051115181307.18c2b27b@localhost.localdomain> <437A1820.8060902@lerdorf.com> <437A1BD1.9030309@lerdorf.com> Subject: Re: [PHP-DEV] date() behaviour changed in 5.1? From: kingwez@gmail.com (Wez Furlong) I can't think of any case where you'd want to error out when given '100 ' if it would accept '100' quite happily. I'd lean towards a single cast semantic for this, and remove that strict checking flag from zend_parse_parameters(); lazy dynamic type handling for primitive data types is one of the cornerstones of PHP IMO. --Wez. On 11/15/05, 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 th= ey'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. > > -Rasmus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >