xref: /PHP-8.4/ext/opcache/tests/gh10914.phpt (revision bc421791)
1--TEST--
2GH-10914 (OPCache with Enum and Callback functions results in segmentation fault)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.protect_memory=1
7opcache.preload={PWD}/preload_gh10914.inc
8--EXTENSIONS--
9opcache
10--SKIPIF--
11<?php
12if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
13?>
14--FILE--
15<?php
16$x = new ReflectionEnum(ExampleEnum::class);
17var_dump($x->getCases()[0]->getValue());
18var_dump($x->getCases()[0]->getBackingValue());
19var_dump($x->getCase('FIRST')->getValue());
20var_dump($x->getCase('FIRST')->getBackingValue());
21?>
22--EXPECT--
23enum(ExampleEnum::FIRST)
24string(4) "AAAb"
25enum(ExampleEnum::FIRST)
26string(4) "AAAb"
27