Fix memory leak when destroying PDORow

This should call zend_object_std_dtor() to clean the property table etc.
This also has a semantic influence because previously weak refs were not
notified for example.

This fixes the final issue in GH-18114 (the crash was master-only and
fixed already).

Closes GH-18114.
Closes GH-18123.
This commit is contained in:
Niels Dossche 2025-03-20 19:21:27 +01:00
parent 6af240d8da
commit 2dde07af55
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
3 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,19 @@
--TEST--
GH-18114 (pdo lazy object crash)
--EXTENSIONS--
pdo_sqlite
--FILE--
<?php
$db = new PDO('sqlite::memory:');
$x = $db->query('select 1 as queryString');
$data = $x->fetch(PDO::FETCH_LAZY);
foreach ($data as $entry) {
var_dump($entry);
}
var_dump((array) $data);
echo "Done\n";
?>
--EXPECT--
array(0) {
}
Done