Re: [VOTE] Void Return Type RFC
| From: | Dan Ackroyd | Date: | Thu, 29 Oct 2015 13:22:00 +0000 |
| Subject: | Re: [VOTE] Void Return Type RFC | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88996@lists.php.net to get a copy of this message | ||
Pedro, your email client snipped off the internals CC
On 29 October 2015 at 13:11, Pedro Cordeiro <pedronaroga@gmail.com> wrote:
> If that callback is actually a void function, then using its return value IS
> an error. The same way using a variable you're not sure exists, using a
> return value that you don't know is there is prone to errors.
>
> The weird thing is disallowing even a null return while still silently using
> null as the return value. It makes no sense.
>
As I said, the current behaviour of PHP of returning a value for all
functions is awesome and eliminates a whole class of errors.
Adding a pseudo-type that makes people want to break this behaviour is not good.
cheers
Dan