xref: /PHP-7.4/ext/pdo_sqlite/tests/bug52487.phpt (revision 26dfce7f)
1--TEST--
2Bug #52487 (PDO::FETCH_INTO leaks memory)
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
6?>
7--FILE--
8<?php
9require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
10$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
11
12$stmt = $db->prepare("select 1 as attr");
13for ($i = 0; $i < 10; $i++) {
14	$stmt->setFetchMode(PDO::FETCH_INTO, new stdClass);
15}
16
17print "ok\n";
18
19?>
20--EXPECT--
21ok
22