xref: /PHP-8.2/ext/pdo_sqlite/tests/bug70221.phpt (revision 74859783)
1--TEST--
2Bug #70221 (persistent sqlite connection + custom function segfaults)
3--EXTENSIONS--
4pdo_sqlite
5--FILE--
6<?php
7$dbfile = __DIR__ . '/test.sqlite';
8$db = new PDO('sqlite:'.$dbfile, null, null, array(PDO::ATTR_PERSISTENT => true));
9function _test() { return 42; }
10$db->sqliteCreateFunction('test', '_test', 0);
11print("Everything is fine, no exceptions here\n");
12unset($db);
13?>
14--CLEAN--
15<?php
16$dbfile = __DIR__ . '/test.sqlite';
17unlink($dbfile);
18?>
19--EXPECT--
20Everything is fine, no exceptions here
21