Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80601 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96883 invoked from network); 15 Jan 2015 23:16:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 23:16:49 -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.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:43644] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/B6-61348-E5A48B45 for ; Thu, 15 Jan 2015 18:16:48 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id D02BB8800E7; Thu, 15 Jan 2015 18:16:43 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pNbuttEdjqZJ; Thu, 15 Jan 2015 18:16:43 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id C62AA8800E2; Thu, 15 Jan 2015 18:16:42 -0500 (EST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <20150115222540.794A226139A@dd15934.kasserver.com> Date: Thu, 15 Jan 2015 23:16:39 +0000 Cc: internals@lists.php.net, rowan.collins@gmail.com Content-Transfer-Encoding: quoted-printable Message-ID: References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <4E2073DE-0951-498C-97BB-DDAC094F11FA@ajf.me> <9a033dd1f223f854e760924d118ab812@mail.gmail.com> <2ae0164cb9b9bf1c974d7a3c60af0466@mail.gmail.com> <6105ea99002e634373c09685310e26a6@mail.gmail.com> <8BABA306-12CE-4568-98F3-419A1557F61B@ajf.me> <20150115201654.4674326139A@dd15934.kasserver.com> <395C69A3-3305-43DF-87D5-128D977EA3ED@gmail.com> <20150115222540.794A226139A@dd15934.kasserver.com> To: Thomas Bley X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: ajf@ajf.me (Andrea Faulds) Hi Thomas, > On 15 Jan 2015, at 22:25, Thomas Bley wrote: >=20 > I think the problem with the current rfc is: >=20 > test(42); > function test(string $a) does test((string)$a); > function test(array $a) does not test((array)$a); although casting = would be possible. >=20 > So for consistency we might change the syntax or adapt array/object = type hints with casting (BC-break). Having it do an explicit cast would make the feature really dangerous. = Explicit casts can=92t fail (except for objects, for whatever reason) = and so they=92ll completely mangle input if it=92s bad. Implicit casts = can fail. I don=92t think this would be a good approach. Thanks. -- Andrea Faulds http://ajf.me/