Re: [RFC] Void Return Type (v0.2, reöp ening)
| From: | Andrea Faulds | Date: | Thu, 15 Oct 2015 15:32:21 +0000 |
| Subject: | Re: [RFC] Void Return Type (v0.2, reöp ening) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88817@lists.php.net to get a copy of this message | ||
Hi Rowan,
Rowan Collins wrote:
But why "invent" (as far as PHP is concerned) this new keyword of "void" to mean exactly the same thing "null" already means - absence of a definite value?They don't mean exactly the same thing. null is a value to represent a lack of a value. But there's also the concept of *no value at all* (a missing variable, say). The closest we have to that in PHP already would actually be
unset, but that's a strange choice given it's not what we use in documentation (function prototypes, PHP manual, PHPDoc, etc. use void), and it's tainted by the bizarro (unset) cast which casts to null.
Thanks.
--
Andrea Faulds
http://ajf.me/