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