Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44577 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93320 invoked from network); 1 Jul 2009 17:22:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2009 17:22:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain punkave.com from 209.85.217.214 cause and error) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.217.214 mail-gx0-f214.google.com Received: from [209.85.217.214] ([209.85.217.214:43608] helo=mail-gx0-f214.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/A0-24906-44B9B4A4 for ; Wed, 01 Jul 2009 13:22:12 -0400 Received: by gxk10 with SMTP id 10so1576118gxk.23 for ; Wed, 01 Jul 2009 10:22:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.17.9 with SMTP id q9mr1972551iba.23.1246468929661; Wed, 01 Jul 2009 10:22:09 -0700 (PDT) In-Reply-To: <20090701171533.GI4355@mint.phcomp.co.uk> References: <20090701171533.GI4355@mint.phcomp.co.uk> Date: Wed, 1 Jul 2009 13:22:09 -0400 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3 From: tom@punkave.com (Tom Boutell) I expect this would be a problem for folks who are relying on the fact that they can parse configuration files and web inputs purely as strings, yet numeric fields containing string representations of numbers will actually behave as numbers if called upon to do so. Speaking of which, when I'm in a hurry and large numbers (or negative numbers) are not dangerous in that particular context, I sometimes validate a numeric field like this: $x =3D $_REQUEST['x'] + 0; And then assume $x will be a number - perhaps an obnoxious number, maybe even a huge floating point number with an exponent, but a number. Is there a flaw in that reasoning that I'm not aware of? On Wed, Jul 1, 2009 at 1:15 PM, Alain Williams wrote: > On Wed, Jul 01, 2009 at 12:59:59PM -0400, Ilia Alshanetsky wrote: >> There has been quite a bit of discussion on this list, IRC, developer >> meetings, etc... about introduction of type hinting to PHP. Most >> people appear to think that this would be a good idea, but there is a >> reason why it is not in PHP already. The main source of conflict >> ... > > Another desirable result of type hinting is that it would strengthen > reflection ... one use of that would be automatic generation of > WSDL files. This is something that I am currently struggling to do, > not helped by the completely cr*p documentation of this - I am not > talking about PHP documentation here by W3 & other places :-( > > +1 to type hinting. > > -- > Alain Williams > Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, I= T Lecturer. > +44 (0) 787 668 0256 =A0http://www.phcomp.co.uk/ > Parliament Hill Computers Ltd. Registration Information: http://www.phcom= p.co.uk/contact.php > Past chairman of UKUUG: http://www.ukuug.org/ > #include > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com