Re: [RFC] Void Return Type (v0.2, reöpeni ng)
| From: | Chris Riley | Date: | Thu, 15 Oct 2015 09:15:14 +0000 |
| Subject: | Re: [RFC] Void Return Type (v0.2, reöpeni ng) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88810@lists.php.net to get a copy of this message | ||
On 14 October 2015 at 22:52, Andrea Faulds <ajf@ajf.me> wrote:
> Good evening,
>
> I'm reviving my Void Return Type RFC, this time for PHP 7.1:
>
> https://wiki.php.net/rfc/void_return_type
>
> Please read it and tell me your thoughts!
>
> Thanks.
>
> P.S. As it so (fatefully?) happens, I originally introduced this on 14th
> February, and it's now 14th October, so it's been exactly 8 months!
>
> --
> Andrea Faulds
> http://ajf.me/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi,
Semantically, I don't believe that there is sufficient difference between
"returns no value" and "returns a value which has been defined as having no
value" for us to care about it. The main difference you get between return
type of null and a return type of void seems to be some extra fatal errors,
for a developer there seems little value.
From a user confusion point of view; PHP currently considers return; and
return null; to be equivalent (in fact some code style checkers will
replace one with the other) If (and only if) a function has a return type
of void these two statements are no longer equivalent - one is a fatal
error one is not. For any other return type specification, return null; and
return; would behave the same. This in itself would be enough for me to be
against adding a return type of void.
(also could someone enable my wiki acc: carnage; sent an email ~a week ago
and haven't heard back yet :()
~C