Skip to content

Commit f77bef3

Browse files
committed
Add test for GH-7821
1 parent 8f14b0e commit f77bef3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Zend/tests/enum/gh8418.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
GH-8418: Enum constant expression evaluation doesn't work with warmed cache
3+
--FILE--
4+
<?php
5+
6+
class ExampleClass
7+
{
8+
public const EXAMPLE_CONST = 42;
9+
}
10+
11+
enum ExampleEnum: int
12+
{
13+
case ENUM_CASE = ExampleClass::EXAMPLE_CONST;
14+
}
15+
16+
var_dump(ExampleEnum::ENUM_CASE->value);
17+
18+
?>
19+
--EXPECT--
20+
int(42)

0 commit comments

Comments
 (0)