Re: [RFC] Transform void into an alias for null
| From: | Tim Düsterhus | Date: | Wed, 04 Jun 2025 08:50:56 +0000 |
| Subject: | Re: [RFC] Transform void into an alias for null | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127575@lists.php.net to get a copy of this message | ||
Hi
Am 2025-06-03 17:46, schrieb Gina P. Banyard:
IMO, these checks are useful enough not to be removed.I believe they agree in that the distinction betweenI agree with Ilija (and also Rowan).Well, I'm not sure Ilija and Rowan agree between each other.
void and null is a useful one.
AFAIU Ilija thinks void living on its weird island is good. Meanwhile, Rowan thinks it is somewhat confusing and that void should be a subtype of null.But indeed I'm more aligned with Ilija than Rowan (that’s why Rowan’s name is in parentheses).
See my reply to your reply to Ilija. Best regards Tim DüsterhusTo me there is an important semantic difference between “not returning anything” and “always returning null”. I believe thatThen our type system is not logical as we have a top type that is not actually a top type.voidbeing in a distinct type hierarchy is the right choice and when considering “untyped returns” to be soft-deprecated / discouraged, there are no inconsistencies either.