1--TEST-- 2PDO_sqlite: Testing createAggregate() 3--EXTENSIONS-- 4pdo_sqlite 5--FILE-- 6<?php 7 8// This test was copied from the pdo_sqlite test for sqliteCreateAggregate 9$db = new Pdo\Sqlite('sqlite::memory:'); 10 11$db->query('CREATE TABLE test_pdo_sqlite_createaggregate (id INT AUTO INCREMENT, name TEXT)'); 12 13$db->query('INSERT INTO test_pdo_sqlite_createaggregate VALUES (NULL, "PHP"), (NULL, "PHP6")'); 14 15$db->createAggregate('testing', function(&$a, $b) { $a .= $b; return $a; }, function(&$v) { return $v; }); 16 17foreach ($db->query('SELECT testing(name) FROM test_pdo_sqlite_createaggregate') as $row) { 18 var_dump($row); 19} 20 21?> 22--EXPECT-- 23array(2) { 24 ["testing(name)"]=> 25 string(2) "12" 26 [0]=> 27 string(2) "12" 28} 29