Commit 8223b6e66d4 for php

commit 8223b6e66d483e4f7b34a09600a9313fcd3e9393
Author: Gina Peter Banyard <girgias@php.net>
Date:   Thu Oct 1 08:54:24 2026 +0100

    spl: use new zend_object_copy() API

diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 7ad54781884..1869fde93e3 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -150,8 +150,7 @@ static spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage
 static spl_SplObjectStorageElement *spl_object_storage_create_element(zend_object *obj, zval *inf) /* {{{ */
 {
 	spl_SplObjectStorageElement *pelement = emalloc(sizeof(spl_SplObjectStorageElement));
-	pelement->obj = obj;
-	GC_ADDREF(obj);
+	pelement->obj = zend_object_copy(obj);
 	if (inf) {
 		ZVAL_COPY(&pelement->inf, inf);
 	} else {
@@ -223,8 +222,7 @@ static spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStora
 		return pelement;
 	}

-	element.obj = obj;
-	GC_ADDREF(obj);
+	element.obj = zend_object_copy(obj);
 	if (inf) {
 		ZVAL_COPY(&element.inf, inf);
 	} else {