1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 17:43:13 +02:00
Files
archived-php-src/ext/sqlite3/tests/sqlite3_37_createfunction_flags.phpt
Remi Collet 012dc336a6 Fix buid with system libsqlite, see bug #74217
SQLITE_DETERMINISTIC only exists in recent version
e.g. missing on 3.7 which is the default on RHEL/CentOS-7
and probably others (wheezy have 3.7, jessie 3.8...)
2017-03-29 07:25:01 +02:00

33 lines
777 B
PHP

--TEST--
SQLite3::createFunction - Test with flags
--SKIPIF--
<?php
require_once(__DIR__ . '/skipif.inc');
if (!defined('SQLITE3_DETERMINISTIC')) die('skip system sqlite is to old');
?>
--FILE--
<?php
require_once(__DIR__ . '/new_db.inc');
$func = 'strtoupper';
var_dump($db->createfunction($func, $func, 1, SQLITE3_DETERMINISTIC));
var_dump($db->querySingle('SELECT strtoupper("test")'));
$func2 = 'strtolower';
var_dump($db->createfunction($func2, $func2, 1, SQLITE3_DETERMINISTIC));
var_dump($db->querySingle('SELECT strtolower("TEST")'));
var_dump($db->createfunction($func, $func2, 1, SQLITE3_DETERMINISTIC));
var_dump($db->querySingle('SELECT strtoupper("tEst")'));
?>
--EXPECTF--
bool(true)
string(4) "TEST"
bool(true)
string(4) "test"
bool(true)
string(4) "test"