summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index ccaf1652c2..03149091fb 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2214,6 +2214,12 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static
if (!CG(active_class_entry)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active");
}
+ if (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) {
+ constant_name.op_type = IS_CONST;
+ ZVAL_STRINGL(&constant_name.u.constant, "class", sizeof("class")-1, 1);
+ zend_do_fetch_constant(result, class_name, &constant_name, ZEND_RT, 1 TSRMLS_CC);
+ break;
+ }
zval_dtor(&class_name->u.constant);
class_name->op_type = IS_CONST;
ZVAL_STRINGL(&class_name->u.constant, CG(active_class_entry)->name, CG(active_class_entry)->name_length, 1);