summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-09-29 07:28:34 +0000
committerDmitry Stogov <dmitry@php.net>2007-09-29 07:28:34 +0000
commit166266df68db50c4d1119f2be265972c8d77f1af (patch)
treedb37ce528d82613d84737d6e30cb8fe8f14c9b78 /Zend/zend_API.c
parente9dd6fab9194b3ae717b79322853dfa6fb64fb28 (diff)
downloadphp-git-166266df68db50c4d1119f2be265972c8d77f1af.tar.gz
Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 667b88cba3..184812941e 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2306,10 +2306,13 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **
}
lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
- if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self")) == 0 && EG(active_op_array)) {
+ if (Z_STRLEN_PP(obj) == sizeof("self") - 1 && memcmp(lcname, "self", sizeof("self")-1) == 0 && EG(active_op_array)) {
ce = EG(active_op_array)->scope;
- } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent")) == 0 && EG(active_op_array) && EG(active_op_array)->scope) {
+ } else if (Z_STRLEN_PP(obj) == sizeof("parent") - 1 && memcmp(lcname, "parent", sizeof("parent")-1) == 0 && EG(active_op_array) && EG(active_op_array)->scope) {
ce = EG(active_op_array)->scope->parent;
+ } else if (Z_STRLEN_PP(obj) == sizeof("static")-1 &&
+ !memcmp(lcname, "static", sizeof("static")-1)) {
+ ce = EG(called_scope);
} else if (zend_lookup_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
}