> Le 17 nov. 2023 à 14:53, Rowan Tommins <rowan.coll...@gmail.com> a écrit :
> 
> On 17 November 2023 13:30:42 GMT, Claude Pache <claude.pa...@gmail.com> wrote:
>> 
>> Yes, except that an untyped (respectively `mixed`) property cannot be 
>> redeclared as `mixed` (resp. untyped) in a subclass. A small step in the 
>> right direction is to allow that.
> 
> Huh, I didn't know that. I'll add it to the RFC, at least to consider.
> 
> The RFC to add "mixed" gives an example of removing the type as invariance, 
> but doesn't seem to justify why "untyped" and "mixed" should be considered 
> different, from a type system point of view. 
> https://wiki.php.net/rfc/mixed_type_v2

Note that untyped is different from `mixed` in the case of return values of 
functions: in that context, untyped is equivalent to `mixed|void`. In all other 
contexts, untyped and `mixed` are effectively equivalent, because `void` is 
void of sense.

—Claude

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

Reply via email to