Skip to content

Commit a942b28

Browse files
committed
Fixed bug #81465
Make the error message for enum cases more technically correct.
1 parent a0bea10 commit a942b28

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Zend/tests/enum/backed-int-const-invalid-expr.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ var_dump(Foo::Bar->value);
1111

1212
?>
1313
--EXPECTF--
14-
Fatal error: Enum case value must be constant in %s on line %d
14+
Fatal error: Enum case value must be compile-time evaluatable in %s on line %d

Zend/zend_compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7829,7 +7829,8 @@ static void zend_compile_enum_case(zend_ast *ast)
78297829
zend_eval_const_expr(&ast->child[1]);
78307830
case_value_ast = ast->child[1];
78317831
if (case_value_ast->kind != ZEND_AST_ZVAL) {
7832-
zend_error_noreturn(E_COMPILE_ERROR, "Enum case value must be constant");
7832+
zend_error_noreturn(
7833+
E_COMPILE_ERROR, "Enum case value must be compile-time evaluatable");
78337834
}
78347835

78357836
zval case_value_zv;

0 commit comments

Comments
 (0)