Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75468 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97503 invoked from network); 14 Jul 2014 14:57:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 14:57:41 -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:50233] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/31-25444-4EFE3C35 for ; Mon, 14 Jul 2014 10:57:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 3AB948800F1; Mon, 14 Jul 2014 10:57:37 -0400 (EDT) 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 ATv_0ySyb7mg; Mon, 14 Jul 2014 10:57:37 -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 175578800EC; Mon, 14 Jul 2014 10:57:35 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Mon, 14 Jul 2014 15:57:32 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <6C08D5C1-7A37-4F49-BF12-96B614B4B50B@ajf.me> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> To: Derick Rethans 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 14 Jul 2014, at 15:54, Derick Rethans wrote: > A compromise by adding more inconsistencies. >=20 > I can buy the cast of scalars vs hint--of-complex types, but = definitely=20 > not the introduction of a new group of casting rules. Keep it simple. It doesn=92t change the casting rules; write an error handler that = ignores E_RECOVERABLE_ERROR and you get exactly the same result as a = manual cast inside the function. Rather, it simply adds validation. The = casting works like casting does everywhere else, but there=92s strict = lossless validation on the type hint, similar to the non-scalar type = hints except more lenient as it allows equivalent values of other types. -- Andrea Faulds http://ajf.me/