Re: [RFC] Undefined Property Error Promotion

From: Date: Fri, 15 Apr 2022 21:40:49 +0000
Subject: Re: [RFC] Undefined Property Error Promotion
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-117535@lists.php.net to get a copy of this message
On 06/04/2022 19:38, Larry Garfield wrote:
On the last point, regarding stdClass, I think the question is whether we want it to be consistent with classed object properties (throw) or with associative arrays (warnings). stdClass is kind of an uncomfortable middle between those two. I'm not sure which is better to align with, although I almost never use stdClass and tell others to avoid it as well so it doesn't really matter to me. :-)
My preference is to treat it like any other property, but I am open to hearing additional comments on this. I'm not sure how much conversation we can expect on this one, if it remains quiet I intend to open the vote in a week or so. As a tangent, R11 has had some comments made about a better method for indicating which property / array keys are expected to be missing, such as: $foo[?'maynotexist'] // returns null and emits no warning Down the line this might allow us to fix up arrays as well, but that's a question for a different RFC. Mark Randall

« previous php.internals (#117535) next »