forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix phpGH-10914: OPCache with Enum and Callback functions results in …
…segmentation fault See linked issue for analysis.
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
GH-10914 (OPCache with Enum and Callback functions results in segmentation fault) | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.protect_memory=1 | ||
opcache.preload={PWD}/preload_gh10914.inc | ||
--EXTENSIONS-- | ||
opcache | ||
--SKIPIF-- | ||
<?php | ||
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows'); | ||
?> | ||
--FILE-- | ||
<?php | ||
$x = new ReflectionEnum(ExampleEnum::class); | ||
var_dump($x->getCases()[0]->getValue()); | ||
var_dump($x->getCases()[0]->getBackingValue()); | ||
var_dump($x->getCase('FIRST')->getValue()); | ||
var_dump($x->getCase('FIRST')->getBackingValue()); | ||
?> | ||
--EXPECT-- | ||
enum(ExampleEnum::FIRST) | ||
string(4) "AAAb" | ||
enum(ExampleEnum::FIRST) | ||
string(4) "AAAb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
enum ExampleEnum: string | ||
{ | ||
case FIRST = "AAA"."b"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters