Re: [RFC][Discussion] Harmonise "untyped" and "typed" properties

From: Date: Mon, 20 Nov 2023 23:08:49 +0000
Subject: Re: [RFC][Discussion] Harmonise "untyped" and "typed" properties
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-121740@lists.php.net to get a copy of this message
On 16/11/2023 20:41, Rowan Tommins wrote:
Hi all, I have finally written up an RFC I have been considering for some time: Harmonise "untyped" and "typed" properties RFC URL: https://wiki.php.net/rfc/mixed_vs_untyped_properties
I've revised the RFC; it now proposes to keep the implicit "= null" for untyped properties, although I'm still interested in suggestions for other strategies around that. I have also added discussion of variance checks (thanks Claude for the tips on that). While doing so, I checked Reflection, and am unsure how to proceed. Currently ReflectionParameter shows a difference between "function foo($bar)" and "function foo(mixed $bar)", even though these are analysed as equivalent in inheritance checks. Should ReflectionProperty also retain this distinction? Was the possibility discussed when "mixed" was introduced of using a ReflectionType of mixed for both cases? Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#121740) next »