Skip to content
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

@carusogabriel
Copy link
Member

@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"]=>

This comment has been minimized.

@carusogabriel

carusogabriel May 12, 2018
Author Member

Are these this warnings right?

This comment has been minimized.

@pmmaga

pmmaga May 12, 2018
Contributor

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

@carusogabriel carusogabriel force-pushed the carusogabriel:warning-unknow-compact-variable branch 3 times, most recently from 704a098 to 4631220 May 25, 2018
@carusogabriel carusogabriel changed the title Make compact function reports undefined passed variables [RFC] Make compact function reports undefined passed variables May 25, 2018
@carusogabriel carusogabriel force-pushed the carusogabriel:warning-unknow-compact-variable branch from 4631220 to ec0c68e May 25, 2018
@marcioAlmada
Copy link
Contributor

@marcioAlmada marcioAlmada commented Jun 6, 2018

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 nikic commented Jun 6, 2018

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

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

@carusogabriel carusogabriel commented Jun 18, 2018

Should be RTM as the RFC was Accepted 😄

@php-pulls
Copy link

@php-pulls php-pulls commented Jun 19, 2018

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 carusogabriel:warning-unknow-compact-variable branch Jun 19, 2018
@Majkl578
Copy link
Contributor

@Majkl578 Majkl578 commented Feb 18, 2019

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

@LC43
Copy link

@LC43 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
8 participants