Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76134 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29659 invoked from network); 25 Jul 2014 19:00:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2014 19:00:16 -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.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:37993] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/49-08559-E39A2D35 for ; Fri, 25 Jul 2014 15:00:16 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DA7E9B0008B; Fri, 25 Jul 2014 15:00:18 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id W9vZL_8bXVog; Fri, 25 Jul 2014 15:00:18 -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 E16B9B0008A; Fri, 25 Jul 2014 15:00:16 -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: Fri, 25 Jul 2014 20:00:13 +0100 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <6A40E21F-D265-4ADC-AD79-4EDB7AB45A01@ajf.me> References: <20A80B2E-42BB-486F-8F83-A6FDBEBA4056@ajf.me>,<5B708D89-B208-4644-BC89-1B7AE98A99BA@ajf.me> To: Theodore Brown 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 20 Jul 2014, at 17:26, Theodore Brown wrote: > The one remaining issue I have with this proposal is that boolean = values are currently accepted for every other scalar type except array. = As with NULL, FALSE is a common error value, and allowing booleans to be = passed to a function expecting a string or numeric value could easily = mask errors and lead to hard-to-debug issues in a program. Just as a = string cannot be passed to a function expecting a boolean, a boolean = should not be passed to a function expecting a string, etc. After consulting with Anthony about this, the RFC and patch have been = updated to disallow booleans for int, float, numeric and string type = hints. The conversions table now looks like this: https://wiki.php.net/rfc/scalar_type_hinting_with_cast#conversion_rules -- Andrea Faulds http://ajf.me/