[php-src] master: pdo: use new zend_object_copy() API

From: Date: Thu, 01 Oct 2026 11:44:38 +0000
Subject: [php-src] master: pdo: use new zend_object_copy() API
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141828@lists.php.net to get a copy of this message
Author: Gina Peter Banyard (Girgias) Date: 2026-10-01T12:43:57+01:00 Commit: https://github.com/php/php-src/commit/1ba5ec7a980b8f72eaac5c9182f53db78b443514 Raw diff: https://github.com/php/php-src/commit/1ba5ec7a980b8f72eaac5c9182f53db78b443514.diff pdo: use new zend_object_copy() API Changed paths: M ext/pdo/pdo_dbh.c M ext/pdo/pdo_stmt.c Diff: diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 7a77fdae31f7..e443aa164e0a 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -653,8 +653,7 @@ PHP_METHOD(PDO, prepare) stmt->default_fetch_type = dbh->default_fetch_type; stmt->dbh = dbh; /* give it a reference to me */ - GC_ADDREF(&dbh_obj->std); - stmt->database_object_handle = &dbh_obj->std; + stmt->database_object_handle = zend_object_copy(&dbh_obj->std); if (dbh->methods->preparer(dbh, statement, stmt, options)) { if (Z_TYPE(ctor_args) == IS_ARRAY) { @@ -1218,8 +1217,7 @@ PHP_METHOD(PDO, query) stmt->default_fetch_type = dbh->default_fetch_type; stmt->dbh = dbh; /* give it a reference to me */ - GC_ADDREF(&dbh_obj->std); - stmt->database_object_handle = &dbh_obj->std; + stmt->database_object_handle = zend_object_copy(&dbh_obj->std); if (dbh->methods->preparer(dbh, statement, stmt, NULL)) { PDO_STMT_CLEAR_ERR(); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index c828cc0bccaf..ebeda0246cf1 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1806,8 +1806,7 @@ bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_a } break; case PDO_FETCH_INTO: - GC_ADDREF(fetch_into); - stmt->fetch.into = fetch_into; + stmt->fetch.into = zend_object_copy(fetch_into); break; default: break;

« previous php.cvs (#141828) next »