Re: [VOTE] Void Return Type RFC
| From: | Marcio Almada | Date: | Fri, 30 Oct 2015 17:47:27 +0000 |
| Subject: | Re: [VOTE] Void Return Type RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89019@lists.php.net to get a copy of this message | ||
Hi,
>
> That's what I am having issue with. I don't see the case where such
> guarantee is useful. If you're not using the return value, why do you
> care if it's always null or sometimes null and sometimes baloney
> sandwich? If you need always null, you have it: null. You don't need to
> use return value of a function for it.
>
> --
> Stas Malyshev
> smalyshev@gmail.com
It's useful because you can guarantee that nobody will rely on some unspecified
behavior that was abusively or mistakenly added by a given implementation:
$status = $poorLogger->critical('should always return null, but this
poor implementation returns true or false');
doSomethingWithLoggerStatus($status);
If we both can't agree that this level of correctness can be useful,
then I rest my case. It's not that important to agree on this anyway.
Have a nice Friday :)
Marcio.