Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fixed static variable in class Lexer.#55

Closed
adrigzr wants to merge 5 commits into
wp-cli:masterwp-cli/php-cli-tools:masterfrom
adrigzr:masteradrigzr/php-cli-tools:masterCopy head branch name to clipboard
Closed

Fixed static variable in class Lexer.#55
adrigzr wants to merge 5 commits into
wp-cli:masterwp-cli/php-cli-tools:masterfrom
adrigzr:masteradrigzr/php-cli-tools:masterCopy head branch name to clipboard

Conversation

@adrigzr

@adrigzr adrigzr commented Jun 16, 2014

Copy link
Copy Markdown

Pulled from https://github.com/wp-cli/php-cli-tools/pull/3, ignore the composer.json.

Static variables are shared between objects. In this case, we dont want this behaviour because each object has his own different properties.

To test it out, just create 2 Lexer objects and try to do 2 foreach with each one. The second object will be bugged in his loop.

This can also be tested calling 'parse' function at least twice in the same runtime.

@danielbachhuber

Copy link
Copy Markdown
Member

@drakson can you rebase against master and include some tests? thanks

@rantonmattei

Copy link
Copy Markdown

PR #79 fixes that bug. You can close this PR once #79 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.