Re: [RFC] Undefined Variable Error Promotion

From: Date: Fri, 18 Feb 2022 11:23:58 +0000
Subject: Re: [RFC] Undefined Variable Error Promotion
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-117063@lists.php.net to get a copy of this message
On 17/02/2022 23:28, Mark Randall wrote:
I present: https://wiki.php.net/rfc/undefined_variable_error_promotion
It would be good to have a "Scope" or "Unaffected Functionality" section here, because there are a number of closely related things which were also raised from Notice to Warning in 8.0: - undefined array keys - undefined object properties - array access on a non-array - property access on a non-object I think it is sensible to discuss those separately, but it would be good to make that clear. Similarly, it would be good to have more discussion of what "accessing" means, as the current examples are quite narrow, only showing direct use and the ++ operator. Other functionality potentially affected: - passing the variable to a function, presumably excluding by-reference parameters which don't currently warn - all the combined assignment operators - https://www.php.net/manual/en/language.operators.assignment.php - the array append operator ($a[] = 42;) does NOT currently give an undefined variable Warning - variable variables, e.g. "$b = 'a'; echo $$b;" - the compact() pseudo-function There's probably others that I've missed. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#117063) next »