1--TEST--
2SQLite3::createFunction - Test with flags
3--EXTENSIONS--
4sqlite3
5--SKIPIF--
6<?php
7if (!defined('SQLITE3_DETERMINISTIC')) die('skip system sqlite is too old');
8?>
9--FILE--
10<?php
11
12require_once(__DIR__ . '/new_db.inc');
13
14$func = 'strtoupper';
15var_dump($db->createfunction($func, $func, 1, SQLITE3_DETERMINISTIC));
16var_dump($db->querySingle('SELECT strtoupper("test")'));
17
18$func2 = 'strtolower';
19var_dump($db->createfunction($func2, $func2, 1, SQLITE3_DETERMINISTIC));
20var_dump($db->querySingle('SELECT strtolower("TEST")'));
21
22var_dump($db->createfunction($func, $func2, 1, SQLITE3_DETERMINISTIC));
23var_dump($db->querySingle('SELECT strtoupper("tEst")'));
24
25
26?>
27--EXPECT--
28bool(true)
29string(4) "TEST"
30bool(true)
31string(4) "test"
32bool(true)
33string(4) "test"
34