From d9d9a974544257f591a993be6089cc15ce4117a4 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 1 Oct 2007 11:25:26 +0000 Subject: [PATCH] Late Static Binding make no sense in compile-time constants. --- Zend/zend_compile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 750b38f884..0dc9a2282f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3751,7 +3751,11 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con switch (mode) { case ZEND_CT: if (constant_container) { - if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_TYPE(constant_container->u.constant), Z_UNIVAL(constant_container->u.constant), Z_UNILEN(constant_container->u.constant))) { + int type = zend_get_class_fetch_type(Z_TYPE(constant_container->u.constant), Z_UNIVAL(constant_container->u.constant), Z_UNILEN(constant_container->u.constant)); + + if (ZEND_FETCH_CLASS_STATIC == type) { + zend_error(E_ERROR, "\"static::\" is not allowed in compile-time constants"); + } else if (ZEND_FETCH_CLASS_DEFAULT == type) { zend_resolve_class_name(constant_container, &fetch_type, 1 TSRMLS_CC); } zend_do_fetch_class_name(NULL, constant_container, constant_name TSRMLS_CC); -- 2.40.0