summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-05-05 12:57:30 +0300
committerDmitry Stogov <dmitry@zend.com>2015-05-05 12:57:30 +0300
commit17e4c628729946a7e9aaa32feb5b6640defe7fe7 (patch)
tree01850012092d4e3a9f1aa2affe56d3fe984c559a
parentd754be166e78a41e1a258c97c43e3d100d41704a (diff)
downloadphp-git-17e4c628729946a7e9aaa32feb5b6640defe7fe7.tar.gz
Removed check for count() in SXE class
-rw-r--r--ext/simplexml/simplexml.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index e71fadaa13..a10def195e 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -2136,17 +2136,21 @@ static zend_function* php_sxe_find_fptr_count(zend_class_entry *ce)
{
zend_function *fptr_count = NULL;
zend_class_entry *parent = ce;
+ int inherited = 0;
while (parent) {
if (parent == sxe_class_entry) {
break;
}
parent = parent->parent;
+ inherited = 1;
}
- fptr_count = zend_hash_str_find_ptr(&ce->function_table, "count", sizeof("count") - 1);
- if (fptr_count->common.scope == parent) {
- fptr_count = NULL;
+ if (inherited) {
+ fptr_count = zend_hash_str_find_ptr(&ce->function_table, "count", sizeof("count") - 1);
+ if (fptr_count->common.scope == parent) {
+ fptr_count = NULL;
+ }
}
return fptr_count;