2 ms·
It's a good point, and one which I personally hadn't thought about. The RFC specifically mentions it, so it's obviously a concern: > Choosing one over the othe
by blowski 10y ago
It's a good point, and one which I personally hadn't thought about. The RFC specifically mentions it, so it's obviously a concern:
> Choosing one over the other suggests intent. If you specify a value, it suggests the value is significant. In a void function, the return value is insignificant: it's always the same and has no actual usefulness.
https://wiki.php.net/rfc/void_return_type#why_isn_t_return_nullpermitted https://wiki.php.net/rfc/void_return_type#why_isn_t_return_n...
I guess this 'pragmatism over consistency' fits in with the general ethos of PHP. I guess it's why so many people hate it, but I can't imagine a situation in which this will actually cause a problem.