Re: [RFC] Mixed type
| From: | Ilija Tovilo | Date: | Thu, 23 Apr 2020 16:27:22 +0000 |
| Subject: | Re: [RFC] Mixed type | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109819@lists.php.net to get a copy of this message | ||
Sorry, I don't know what's wrong with my mail client, it just sent the
email with no content. Here's it again.
Hi Dan
> Here is an RFC for adding a 'mixed' type to the language:
> https://wiki.php.net/rfc/mixed_type_v2
> The RFC builds on an earlier draft by Michael Moravec.
I don't have a whole lot to add other than I appreciate this RFC. We
currently can't differentiate between "I didn't bother documenting
this" and "yes, I actually accept all types".
One note: I was wondering if the following code throws an error (it does):
function foo(): mixed {}
foo();
//> Uncaught TypeError: Return value of foo() must be of the type
mixed, none returned
I found the answer in the tests. Might be worth mentioning in the RFC.
Regards,
Ilija