Bug #73789 [Com]: Strange behavior of class constants in switch/case block
| From: | oliver dot hader at typo3 dot org | Date: | Tue, 20 Dec 2016 15:36:48 +0000 |
| Subject: | Bug #73789 [Com]: Strange behavior of class constants in switch/case block | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206159@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73789&edit=1
ID: 73789
Comment by: oliver dot hader at typo3 dot org
Reported by: oliver dot hader at typo3 dot org
Summary: Strange behavior of class constants in switch/case
block
Status: Closed
Type: Bug
Package: CGI/CLI related
Operating System: Mac OS
PHP Version: 7.1.0
Block user comment: N
Private report: N
New Comment:
I can confirm that the issue was OPcache-related and that provided fix solved the issue. Thanks for
taking care!
Previous Comments:
------------------------------------------------------------------------
[2016-12-20 13:02:16] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6bd41a1d47417ad2c7938a57c8abca4e210d5cf6
Log: Fixed bug #73789 (Strange behavior of class constants in switch/case block)
------------------------------------------------------------------------
[2016-12-20 11:45:42] laruence@php.net
could you please verify if following path works?
https://gist.github.com/laruence/54ad3436af0f46aac8f8009f25558d49
------------------------------------------------------------------------
[2016-12-20 11:32:38] cmb@php.net
> The behavior occurs only in PHP 7.1.0 CGI context, using the CLI
> wrapper everything works as expected.
Is this perhaps on OPcache issue?
------------------------------------------------------------------------
[2016-12-19 19:12:48] oliver dot hader at typo3 dot org
I forgot to mention, that I could reproduce this behavior in PHP 7.1-RC5 as well.
------------------------------------------------------------------------
[2016-12-19 19:04:21] oliver dot hader at typo3 dot org
Description:
------------
The behavior occurs only in PHP 7.1.0 CGI context, using the CLI wrapper everything works as
expected. Besides that, the scenario seems to at least require a switch/case block, several class
constants and constant look-ups and multiple return types.
Find further down the minimal source code that is required to reproduce this issue. Parts of the
code were taken from the TYPO3 CMS project, where this issue has been identified and worked around
in a specific patch (https://review.typo3.org/#/c/50998/).
On executing the test script, the PHP process hangs and consumes a lot of CPU.
Test script:
---------------
see https://gist.github.com/ohader/ed0093e95f7f88714903425021f2b426
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73789&edit=1