xref: /PHP-5.6/ext/pdo_sqlite/tests/bug52487.phpt (revision 93826511)
1--TEST--
2Bug #52487 (PDO::FETCH_INTO leaks memory)
3--SKIPIF--
4<?php # vim:ft=php
5if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
6?>
7--FILE--
8<?php
9require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
10$db = PDOTest::test_factory(dirname(__FILE__) . '/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