diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 4098382c61c..991fa88ded6 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -177,7 +177,11 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zend_o } while (parent) { - if (parent == spl_ce_ArrayIterator || parent == spl_ce_RecursiveArrayIterator || parent == spl_ce_ArrayObject) { + if (parent == spl_ce_ArrayIterator || parent == spl_ce_RecursiveArrayIterator) { + intern->std.handlers = &spl_handler_ArrayIterator; + break; + } else if (parent == spl_ce_ArrayObject) { + intern->std.handlers = &spl_handler_ArrayObject; break; } parent = parent->parent; @@ -1777,7 +1781,6 @@ PHP_MINIT_FUNCTION(spl_array) { spl_ce_ArrayObject = register_class_ArrayObject(zend_ce_aggregate, zend_ce_arrayaccess, zend_ce_serializable, zend_ce_countable); spl_ce_ArrayObject->create_object = spl_array_object_new; - spl_ce_ArrayObject->default_object_handlers = &spl_handler_ArrayObject; memcpy(&spl_handler_ArrayObject, &std_object_handlers, sizeof(zend_object_handlers)); @@ -1803,7 +1806,6 @@ PHP_MINIT_FUNCTION(spl_array) spl_ce_ArrayIterator = register_class_ArrayIterator(spl_ce_SeekableIterator, zend_ce_arrayaccess, zend_ce_serializable, zend_ce_countable); spl_ce_ArrayIterator->create_object = spl_array_object_new; - spl_ce_ArrayIterator->default_object_handlers = &spl_handler_ArrayIterator; spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator; memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers)); diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index a3c17d59668..186b9a34c7e 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -344,11 +344,14 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zend_ while (parent) { if (parent == spl_ce_SplStack) { intern->flags |= (SPL_DLLIST_IT_FIX | SPL_DLLIST_IT_LIFO); + intern->std.handlers = &spl_handler_SplDoublyLinkedList; } else if (parent == spl_ce_SplQueue) { intern->flags |= SPL_DLLIST_IT_FIX; + intern->std.handlers = &spl_handler_SplDoublyLinkedList; } if (parent == spl_ce_SplDoublyLinkedList) { + intern->std.handlers = &spl_handler_SplDoublyLinkedList; break; } @@ -1254,7 +1257,6 @@ PHP_MINIT_FUNCTION(spl_dllist) /* {{{ */ zend_ce_iterator, zend_ce_countable, zend_ce_arrayaccess, zend_ce_serializable ); spl_ce_SplDoublyLinkedList->create_object = spl_dllist_object_new; - spl_ce_SplDoublyLinkedList->default_object_handlers = &spl_handler_SplDoublyLinkedList; spl_ce_SplDoublyLinkedList->get_iterator = spl_dllist_get_iterator; memcpy(&spl_handler_SplDoublyLinkedList, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 5c013408ea9..a00bb8965af 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -282,6 +282,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z while (parent) { if (parent == spl_ce_SplFixedArray) { + intern->std.handlers = &spl_handler_SplFixedArray; break; } @@ -958,7 +959,6 @@ PHP_MINIT_FUNCTION(spl_fixedarray) spl_ce_SplFixedArray = register_class_SplFixedArray( zend_ce_aggregate, zend_ce_arrayaccess, zend_ce_countable, php_json_serializable_ce); spl_ce_SplFixedArray->create_object = spl_fixedarray_new; - spl_ce_SplFixedArray->default_object_handlers = &spl_handler_SplFixedArray; spl_ce_SplFixedArray->get_iterator = spl_fixedarray_get_iterator; memcpy(&spl_handler_SplFixedArray, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 64fe962ee2d..db35511f08d 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -428,6 +428,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zend_ob while (parent) { if (parent == spl_ce_SplPriorityQueue) { intern->heap = spl_ptr_heap_init(spl_ptr_pqueue_elem_cmp, spl_ptr_heap_pqueue_elem_ctor, spl_ptr_heap_pqueue_elem_dtor, sizeof(spl_pqueue_elem)); + intern->std.handlers = &spl_handler_SplPriorityQueue; intern->flags = SPL_PQUEUE_EXTR_DATA; break; } @@ -437,6 +438,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zend_ob intern->heap = spl_ptr_heap_init( parent == spl_ce_SplMinHeap ? spl_ptr_heap_zval_min_cmp : spl_ptr_heap_zval_max_cmp, spl_ptr_heap_zval_ctor, spl_ptr_heap_zval_dtor, sizeof(zval)); + intern->std.handlers = &spl_handler_SplHeap; break; } @@ -1127,7 +1129,6 @@ PHP_MINIT_FUNCTION(spl_heap) /* {{{ */ { spl_ce_SplHeap = register_class_SplHeap(zend_ce_iterator, zend_ce_countable); spl_ce_SplHeap->create_object = spl_heap_object_new; - spl_ce_SplHeap->default_object_handlers = &spl_handler_SplHeap; spl_ce_SplHeap->get_iterator = spl_heap_get_iterator; memcpy(&spl_handler_SplHeap, &std_object_handlers, sizeof(zend_object_handlers)); @@ -1148,7 +1149,6 @@ PHP_MINIT_FUNCTION(spl_heap) /* {{{ */ spl_ce_SplPriorityQueue = register_class_SplPriorityQueue(zend_ce_iterator, zend_ce_countable); spl_ce_SplPriorityQueue->create_object = spl_heap_object_new; - spl_ce_SplPriorityQueue->default_object_handlers = &spl_handler_SplPriorityQueue; spl_ce_SplPriorityQueue->get_iterator = spl_pqueue_get_iterator; memcpy(&spl_handler_SplPriorityQueue, &std_object_handlers, sizeof(zend_object_handlers));