mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Allow arbitrary const expressions in backed enums
Closes GH-7821 Closes GH-8190 Closes GH-8418
This commit is contained in:
parent
5a855ee8d6
commit
ddc0b490f7
23 changed files with 287 additions and 144 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "zend_closures.h"
|
||||
#include "zend_inheritance.h"
|
||||
#include "zend_ini.h"
|
||||
#include "zend_enum.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@ -1493,6 +1494,12 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
|
|||
}
|
||||
}
|
||||
|
||||
if (class_type->type == ZEND_USER_CLASS && class_type->ce_flags & ZEND_ACC_ENUM && class_type->enum_backing_type != IS_UNDEF) {
|
||||
if (zend_enum_build_backed_enum_table(class_type) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
ce_flags &= ~ZEND_ACC_HAS_AST_CONSTANTS;
|
||||
ce_flags &= ~ZEND_ACC_HAS_AST_PROPERTIES;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue