Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions ext/simplexml/simplexml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,27 +2156,14 @@ static void sxe_object_free_storage(zend_object *object)
/* {{{ php_sxe_find_fptr_count() */
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 == ce_SimpleXMLElement) {
break;
if (ce->type == ZEND_USER_CLASS) {
zend_function *fptr_count = zend_hash_find_ptr(&ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT));
if (fptr_count->common.scope != ce_SimpleXMLElement) {
return fptr_count;
}
parent = parent->parent;
inherited = 1;
}

if (inherited) {
/* Find count() method */
fptr_count = zend_hash_find_ptr(&ce->function_table, ZSTR_KNOWN(ZEND_STR_COUNT));
if (fptr_count->common.scope == parent) {
fptr_count = NULL;
}
}

return fptr_count;
return NULL;
}
/* }}} */

Expand Down