On Mon, Apr 20, 2020 at 5:17 PM Larry Garfield <la...@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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to