summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorGuilherme Blanco <guilhermeblanco@hotmail.com>2014-12-01 18:44:07 +0000
committerJulien Pauli <jpauli@php.net>2015-01-09 15:45:01 +0100
commitf48c2327403ce76a870e74f31a069a64dfb711a2 (patch)
treeaa60158aa47f17b7868cfc3e6895e0c5cb217c55 /Zend/zend_compile.c
parent63346f4c4bf4ef5d33771d6d96f746a8516e0bcc (diff)
downloadphp-git-f48c2327403ce76a870e74f31a069a64dfb711a2.tar.gz
Decoupled class declaration statement into more granular pieces.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c06ebc4595..0164515b20 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -540,6 +540,22 @@ void zend_do_free(znode *op1) /* {{{ */
}
/* }}} */
+uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag) /* {{{ */
+{
+ uint32_t new_flags = flags | new_flag;
+ if ((flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS) && (new_flag & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed");
+ }
+ if ((flags & ZEND_ACC_FINAL) && (new_flag & ZEND_ACC_FINAL)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Multiple final modifiers are not allowed");
+ }
+ if ((new_flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS) && (new_flags & ZEND_ACC_FINAL)) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class");
+ }
+ return new_flags;
+}
+/* }}} */
+
uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag) /* {{{ */
{
uint32_t new_flags = flags | new_flag;