Hi Dan,

While I have some sympathy for your first point:

>I (and others) brought this up during the void RFC:
>https://news-web.php.net/php.internals/88990 and said that null was
>the right choice over void, as it matches what the language actually
>does.

I disagree with your second, which doesn't follow at all:

>That would have left void available to mean 'this function' does not
>exit normally.

Using "void" for this would be even more confusing than what we have now. If 
anything, "void" should have been reserved for an implementation that checked 
correct usage at the call site, as happens in other languages. Although, if 
someone can come up with an implementation of that, adding it with a suitable 
lead in time would still be possible.

It's also something of a moot point, since even if we introduced a null return 
type (which would be a subtly different feature from void as currently 
implemented), we couldn't suddenly repurpose a keyword that's already used. So 
if you think "never returns" is something worth representing, it will need a 
new keyword, several options for which have been proposed.

Regards,

-- 
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to