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