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

Switch statement error with pre-defined constants #198

Open
timwhitlock opened this issue Dec 26, 2014 · 3 comments
Open

Switch statement error with pre-defined constants #198

timwhitlock opened this issue Dec 26, 2014 · 3 comments
Labels

Comments

@timwhitlock
Copy link

This odd switch error seems to affect the testing of pre-defined constants when the statement has multiple cases to one break.

switch( PHP_VERSION ) {
case 'anything':
case '5.4.36': 
    break;
default:
    echo PHP_VERSION,"\n"; // <- prints "5.4.36"
}

In the above version of PHP using OPcache version 7.0.3FE The value doesn't seem to move on from the first failed case, so the second equality is not evaluated. The error doesn't occur with user-defined constants or variables.

I can post my opcache ini settings if it helps.

@dstogov
Copy link
Contributor

dstogov commented Dec 26, 2014

I can't reproduce this.

Thanks. Dmitry.

On Fri, Dec 26, 2014 at 5:04 PM, Tim Whitlock notifications@github.com
wrote:

This odd switch error seems to affect the testing of pre-defined constants
when the statement has multiple cases to one break.

switch( PHP_VERSION ) {case 'anything':case '5.4.36': break;default: echo PHP_VERSION,"\n"; // <- prints "5.4.36"}

In the above version of PHP using OPcache version 7.0.3FE The value
doesn't seem to fall through from the first break, so the second equality
is not evaluated. The error doesn't occur with user-defined constants or
variables.

I can post my opcache ini settings if it helps.


Reply to this email directly or view it on GitHub
#198.

@timwhitlock
Copy link
Author

Appears to only affect Mac OS X, including Linux VMs running on Mac.
Also seems that 7.0.2 is unaffected.

@laruence
Copy link
Contributor

I remembered I fixed a similar bug before, could you please try with 7.0.5 again?

@laruence laruence added the bug label Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants