Re: [RFC] Mixed type
| From: | Guilliam Xavier | Date: | Mon, 20 Apr 2020 16:40:57 +0000 |
| Subject: | Re: [RFC] Mixed type | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109725@lists.php.net to get a copy of this message | ||
On Mon, Apr 20, 2020 at 5:17 PM Larry Garfield <larry@garfieldtech.com> wrote:
>
> With union types and stringable already on the way, I'm not sure what other
> non-hypothetical use cases would still be that fugly that you'd now need to fall back to
>
mixed.
For instance:
- the parameter of [a wrapper around] gettype() or an is_* function
- the return of [a generic implementation of]
ArrayAccess::offsetGet() or Iterator::current(), or of a userland
array_value_first() or array_value_last() function
To me, especially the return type declaration can be useful to ensure
that [every code path of] the implementation returns a value.
--
Guilliam Xavier