diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-09-29 07:28:34 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-09-29 07:28:34 +0000 |
commit | 166266df68db50c4d1119f2be265972c8d77f1af (patch) | |
tree | db37ce528d82613d84737d6e30cb8fe8f14c9b78 /Zend/zend_constants.c | |
parent | e9dd6fab9194b3ae717b79322853dfa6fb64fb28 (diff) | |
download | php-git-166266df68db50c4d1119f2be265972c8d77f1af.tar.gz |
Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
Diffstat (limited to 'Zend/zend_constants.c')
-rw-r--r-- | Zend/zend_constants.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 13f9ba9848..2c0c57a7d8 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -317,6 +317,14 @@ ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_ ce = scope->parent; } efree(lcname); + } else if (class_name_len == sizeof("static")-1 && + !memcmp(lcname, "static", sizeof("static")-1)) { + if (EG(called_scope)) { + ce = EG(called_scope); + } else { + zend_error(E_ERROR, "Cannot access static:: when no class scope is active"); + } + efree(lcname); } else { /* Check for namespace constant */ char *nsname; |