Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75390 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19369 invoked from network); 13 Jul 2014 11:48:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2014 11:48:19 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.207 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.207 imap2-2.ox.privateemail.com Received: from [192.64.116.207] ([192.64.116.207:52466] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/70-16748-20272C35 for ; Sun, 13 Jul 2014 07:48:18 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id C15A28C007B; Sun, 13 Jul 2014 07:48:15 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0t_7EwtYG50y; Sun, 13 Jul 2014 07:48:15 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 652988C007D; Sun, 13 Jul 2014 07:48:12 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <2f218b4d8cffb1a55e464e715c319b1f@mail.gmail.com> Date: Sun, 13 Jul 2014 12:48:09 +0100 Cc: Alain Williams , Lester Caine , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C2178E.7070705@sugarcrm.com> <53C24061.6050503@lsces.co.uk> <20140713101840.GR6540@phcomp.co.uk> <2f218b4d8cffb1a55e464e715c319b1f@mail.gmail.com> To: Zeev Suraski X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: ajf@ajf.me (Andrea Faulds) On 13 Jul 2014, at 12:35, Zeev Suraski wrote: > I haven't yet reviewed the conversion table in detail, but unless I'm > missing something, this RFC is in fact much more in the spirit of PHP = - > and implements type juggling - unlike the previous incarnation of = strict > typing that almost made it into PHP. It's a bit too strict to my = liking > (especially around conversion of floating point to int, which should = pass > and perhaps generate a notice IMHO), but this is a big step towards = the > spirit of what I proposed together with Lukas back in 2010 > (https://wiki.php.net/rfc/typecheckingstrictandweak) - which was an > alternative to the strong typing suggested by several others. >=20 >=20 > Type juggling is an *inherent* feature of PHP. Paraphrasing what = Rasmus > said several years ago(*), 'if you implement this [strong typing], = please > don't call it PHP'. >=20 > Again, luckily, what Andrea proposes isn't strong typing. It still > maintains the most important properties of type juggling - e.g. the > ability to work with strings coming in as input (GET/POST/etc.) = without > having to worry about typing. Right. I think this RFC would strengthen PHP=92s weak typing guarantees, = because while internal functions will convert to the right type and = hence avoid issues with strings and such not acting quite like integers = in some situations, userland functions usually don=92t. This RFC would = mean that, at least for =93hinted=94 functions, = user_land_function($_GET[=91id=92]) should work just as well as = internal_function($_GET[=91id=92]). Also, it=92s not really =93what Andrea proposes=94, it=92s Anthony=92s = proposal, even if he is sadly absent from the list these days. I=92m = just trying to fix up the patch, iron out remaining wrinkles, and get = this into PHP. -- Andrea Faulds http://ajf.me/