Re: [RFC] Transform void into an alias for null
| From: | Tim Düsterhus | Date: | Wed, 04 Jun 2025 08:48:12 +0000 |
| Subject: | Re: [RFC] Transform void into an alias for null | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127574@lists.php.net to get a copy of this message | ||
Hi
Am 2025-06-03 17:42, schrieb Gina P. Banyard:
A type system should be logical, and the fact that the top type (mixed) is not a super-type of all types doesn't make any sense.I do not consider
void to be a type per se, but rather as an indicator for the absence of a value. Basically the difference between a “procedure” and a “function” [1]. That's why it makes sense to me to treat void differently from the other types. See also: The (void) cast which we decided to make a statement rather than an expression that always evaluates to null.
Best regards
Tim Düsterhus
[1] https://stackoverflow.com/a/721132