1--TEST--
2SQLite3 load extension
3--EXTENSIONS--
4sqlite3
5--SKIPIF--
6<?php
7$r = new ReflectionClass("sqlite3");
8if (!$r->hasMethod("loadExtension")) {
9    die("skip - sqlite3 doesn't have loadExtension enabled");
10}
11?>
12--INI--
13open_basedir=.
14sqlite3.extension_dir=.
15--FILE--
16<?php
17
18require_once(__DIR__ . '/new_db.inc');
19
20$directory = __DIR__;
21
22touch($directory . '/myext.txt');
23
24var_dump($db->loadExtension('myext.txt'));
25var_dump($db->close());
26unlink($directory . '/myext.txt');
27
28echo "Done\n";
29?>
30--EXPECTF--
31Warning: SQLite3::loadExtension(): Unable to load extension at '.%emyext.txt' in %s on line %d
32bool(false)
33bool(true)
34Done
35