-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Make compact function reports undefined passed variables #3240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Make compact function reports undefined passed variables #3240
Conversation
@@ -28,17 +28,22 @@ var_dump( | |||
); | |||
|
|||
?> | |||
--EXPECT-- | |||
--EXPECTF-- | |||
Warning: compact(): Undefined variable: this in %s on line %d | |||
array(1) { | |||
["this"]=> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these this
warnings right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be related to it only dealing with this
a couple lines below in https://github.com/php/php-src/pull/3240/files#diff-497f073aa1ab88afcb8b248fc25d2a12R2595
I see there is a special branch for '$this' but do we have a test covering it? Anyway, a minor detail, voted yes! |
@marcioAlmada Yes, see #3240 (comment) :) |
Should be RTM as the RFC was Accepted 😄 |
Comment on behalf of cmb at php.net: Thanks. Applied via fc775f6. |
@LC43 It is possible to declare variables with such malformed names: https://3v4l.org/M9mAJ |
oops, thanks for the correction, @Majkl578! I'll remove my initial comment |
Ref: https://externals.io/message/102012
RFC: https://wiki.php.net/rfc/compact