1--TEST-- 2SQLite3::createFunction trampoline callback 3--EXTENSIONS-- 4sqlite3 5--FILE-- 6<?php 7 8require_once(__DIR__ . '/new_db.inc'); 9 10class TrampolineTest { 11 public function __call(string $name, array $arguments) { 12 echo 'Trampoline for ', $name, PHP_EOL; 13 return strtoupper($arguments[0]); 14 } 15} 16$o = new TrampolineTest(); 17$callback = [$o, 'strtoupper']; 18var_dump($db->createfunction('strtoupper', $callback)); 19var_dump($db->querySingle('SELECT strtoupper("test")')); 20var_dump($db->querySingle('SELECT strtoupper("test")')); 21 22?> 23--EXPECT-- 24bool(true) 25Trampoline for strtoupper 26string(4) "TEST" 27Trampoline for strtoupper 28string(4) "TEST" 29