Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75689 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93327 invoked from network); 18 Jul 2014 13:09:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2014 13:09:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; 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:44989] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/02-15959-4AC19C35 for ; Fri, 18 Jul 2014 09:09:56 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id C0B2B8800DA; Fri, 18 Jul 2014 09:09:53 -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 aqyNj5rjxyv3; Fri, 18 Jul 2014 09:09:53 -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 A0B508800E6; Fri, 18 Jul 2014 09:09:52 -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, 18 Jul 2014 14:09:49 +0100 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <20A80B2E-42BB-486F-8F83-A6FDBEBA4056@ajf.me> References: 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 18 Jul 2014, at 06:02, Theodore Brown wrote: > Another concern I have is in regard to the future. I'm looking forward = to the=20 > possibility of specifying nullable types in a future version of PHP = (see Levi Morrison's "Declaring Nullable Types" RFC: = http://wiki.php.net/rfc/nullable_typehints). If the=20 > nullable types RFC is accepted, it would be highly disconcerting if = scalar type=20 > annotations allowed null values regardless of whether a nullable = marker is specified. The current proposed behaviour could be changed. At the moment, if a = scalar type hint is nullable, then it won=92t cast NULL if it=92s passed = that value, but if it=92s not nullable, then it will cast it. Considering how this tends to only allow lossless casts, though, it = might be worth reconsidering this and just disallowing NULL altogether. = It=92s worth pointing out that NULL is usually an error value, and you = might get it from using an uninitialised variable or calling an internal = function with bad parameters. -- Andrea Faulds http://ajf.me/