. Fixed bug #71820 (pg_fetch_object binds parameters before
call constructor). (Anatol)
+- SPL:
+ . Fixed bug #67582 (Cloned SplObjectStorage with overwritten getHash fails
+ offsetExists()). (Nikita)
+
- Standard:
. Fixed bug #71840 (Unserialize accepts wrongly data). (Ryat, Laruence)
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) spl_SplOjectStorage_free_storage, NULL TSRMLS_CC);
retval.handlers = &spl_handler_SplObjectStorage;
- if (orig) {
- spl_SplObjectStorage *other = (spl_SplObjectStorage*)zend_object_store_get_object(orig TSRMLS_CC);
- spl_object_storage_addall(intern, orig, other TSRMLS_CC);
- }
-
while (parent) {
if (parent == spl_ce_SplObjectStorage) {
if (class_type != spl_ce_SplObjectStorage) {
parent = parent->parent;
}
+ if (orig) {
+ spl_SplObjectStorage *other = (spl_SplObjectStorage*)zend_object_store_get_object(orig TSRMLS_CC);
+ spl_object_storage_addall(intern, orig, other TSRMLS_CC);
+ }
+
return retval;
}
/* }}} */
--- /dev/null
+--TEST--
+Bug #67582: Cloned SplObjectStorage with overwritten getHash fails offsetExists()
+--FILE--
+<?php
+
+class MyObjectStorage extends SplObjectStorage {
+ // Overwrite getHash() with just some (working) test-method
+ public function getHash($object) { return get_class($object); }
+}
+
+class TestObject {}
+
+$list = new MyObjectStorage();
+$list->attach(new TestObject());
+
+foreach($list as $x) var_dump($list->offsetExists($x));
+
+$list2 = clone $list;
+foreach($list2 as $x) var_dump($list2->offsetExists($x));
+
+?>
+--EXPECT--
+bool(true)
+bool(true)