summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/tests/bug52487.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_sqlite/tests/bug52487.phpt')
-rw-r--r--ext/pdo_sqlite/tests/bug52487.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/tests/bug52487.phpt b/ext/pdo_sqlite/tests/bug52487.phpt
new file mode 100644
index 0000000..fc65bd3
--- /dev/null
+++ b/ext/pdo_sqlite/tests/bug52487.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #52487 (PDO::FETCH_INTO leaks memory)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$stmt = $db->prepare("select 1 as attr");
+for ($i = 0; $i < 10; $i++) {
+ $stmt->setFetchMode(PDO::FETCH_INTO, new stdClass);
+}
+
+print "ok\n";
+
+?>
+--EXPECT--
+ok