Skip to content

[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

Closed
wants to merge 1 commit into from
Closed

[RFC] Make compact function reports undefined passed variables #3240

wants to merge 1 commit into from

Conversation

carusogabriel
Copy link
Contributor

@carusogabriel carusogabriel commented May 12, 2018

@@ -28,17 +28,22 @@ var_dump(
);

?>
--EXPECT--
--EXPECTF--
Warning: compact(): Undefined variable: this in %s on line %d
array(1) {
["this"]=>
Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carusogabriel carusogabriel changed the title Make compact function reports undefined passed variables [RFC] Make compact function reports undefined passed variables May 25, 2018
@marcioAlmada
Copy link
Contributor

I see there is a special branch for '$this' but do we have a test covering it? Anyway, a minor detail, voted yes!

@nikic
Copy link
Member

nikic commented Jun 6, 2018

@marcioAlmada Yes, see #3240 (comment) :)

@krakjoe krakjoe added the RFC label Jun 14, 2018
@carusogabriel
Copy link
Contributor Author

Should be RTM as the RFC was Accepted 😄

@php-pulls
Copy link

Comment on behalf of cmb at php.net:

Thanks. Applied via fc775f6.

@php-pulls php-pulls closed this Jun 19, 2018
@carusogabriel carusogabriel deleted the warning-unknow-compact-variable branch June 19, 2018 10:54
@Majkl578
Copy link
Contributor

@LC43 It is possible to declare variables with such malformed names: https://3v4l.org/M9mAJ

@LC43
Copy link

LC43 commented Feb 18, 2019

oops, thanks for the correction, @Majkl578! I'll remove my initial comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants