xref: /PHP-7.0/ext/pdo_sqlite/tests/bug70221.phpt (revision 5360b3de)
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@unlink($dbfile);
16?>
17--EXPECT--
18Everything is fine, no exceptions here
19