Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88832 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58172 invoked from network); 15 Oct 2015 19:33:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2015 19:33:09 -0000 X-Host-Fingerprint: 2.123.167.169 unknown Received: from [2.123.167.169] ([2.123.167.169:3570] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/2B-23021-37FFF165 for ; Thu, 15 Oct 2015 15:33:08 -0400 Message-ID: To: internals@lists.php.net References: <0A.C2.33697.6AECE165@pb1.pair.com> <561F7D17.5050306@gmail.com> <561FCD9F.10104@gmail.com> <90.58.23021.E85DF165@pb1.pair.com> <561FD658.202@gmail.com> Date: Thu, 15 Oct 2015 20:33:04 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: <561FD658.202@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 2.123.167.169 Subject: =?UTF-8?Q?Re:_[PHP-DEV]_[RFC]_Void_Return_Type_=28v0.2=2c_re=c3=b6p?= =?UTF-8?Q?ening=29?= From: ajf@ajf.me (Andrea Faulds) Hi Rowan, Rowan Collins wrote: > Andrea Faulds wrote on 15/10/2015 17:34: >> Hi Pedro, >> >> Pedro Cordeiro wrote: >>> I've been thinking about what PHP should do when accessing the return >>> value >>> of a `void` function, and so far, I think the consistent thing should >>> be to >>> get NULL, while throwing an E_NOTICE. >> >> We could do this, but I do wonder if it might cause a lot of E_NOTICEs >> to pop up for existing code, assuming we applied this to built-in PHP >> functions. >> >> I'm not sure. > > > The way Pedro described it, it wouldn't apply to any existing functions > because they wouldn't be declared void. > > Obviously, type hints for internal functions are a bit weird anyway, but > there's no reason to assume that every function documented as void would > suddenly be annotated in the Engine as such and start returning notices. Why shouldn't it? For the scalar types, internal and userland functions behave almost the same. I'd like there the two to converge, not diverge. -- Andrea Faulds http://ajf.me/