1--TEST-- 2Observer: PDO::sqliteCreateFunction() can be observed 3--EXTENSIONS-- 4zend_test 5pdo 6pdo_sqlite 7--INI-- 8zend_test.observer.enabled=1 9zend_test.observer.show_output=1 10zend_test.observer.observe_all=1 11--FILE-- 12<?php 13 14function returnOne() { 15 return 1; 16} 17 18$db = new PDO('sqlite::memory:'); 19$db->sqliteCreateFunction('returnOne', 'returnOne', 0); 20 21foreach ($db->query('SELECT returnOne()') as $row) { 22 var_dump($row); 23} 24 25echo 'Done' . PHP_EOL; 26?> 27--EXPECTF-- 28<!-- init '%s' --> 29<file '%s'> 30 <!-- init PDO::__construct() --> 31 <PDO::__construct> 32 </PDO::__construct> 33 <!-- init PDO::sqliteCreateFunction() --> 34 <PDO::sqliteCreateFunction> 35 </PDO::sqliteCreateFunction> 36 <!-- init PDO::query() --> 37 <PDO::query> 38 <!-- init returnOne() --> 39 <returnOne> 40 </returnOne> 41 </PDO::query> 42 <!-- init var_dump() --> 43 <var_dump> 44array(2) { 45 ["returnOne()"]=> 46 int(1) 47 [0]=> 48 int(1) 49} 50 </var_dump> 51Done 52</file '%s'> 53