--TEST-- GH-16703: Memory leak of setFetchMode() --EXTENSIONS-- pdo --SKIPIF-- --FILE-- PDO::CASE_LOWER, PDO::ATTR_STATEMENT_CLASS => [TestStmt::class], ], ); $db->exec('CREATE TABLE gh16703 (name varchar(255))'); $db->exec("INSERT INTO gh16703 (name) VALUES ('test_name')"); $stmt = $db->query('SELECT name FROM gh16703'); $t = $stmt; $stmt->setFetchMode(PDO::FETCH_INTO, $stmt); $stmt->fetch(); echo "done!\n"; ?> --CLEAN-- exec('DROP TABLE gh16703'); ?> --EXPECT-- done!