1--TEST-- 2PDO Common: PECL Bug #5772 (PDO::FETCH_FUNC breaks on mixed case func name) 3--SKIPIF-- 4<?php # vim:ft=php: 5if (!extension_loaded('pdo')) die('skip'); 6$dir = getenv('REDIR_TEST_DIR'); 7if (false == $dir) die('skip no driver'); 8require_once $dir . 'pdo_test.inc'; 9PDOTest::skip(); 10?> 11--FILE-- 12<?php 13if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); 14require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; 15$db = PDOTest::factory(); 16 17$db->exec("CREATE TABLE test (id int NOT NULL, PRIMARY KEY (id))"); 18$db->exec("INSERT INTO test (id) VALUES (1)"); 19 20function heLLO($row) { 21 return $row; 22} 23 24foreach ($db->query("SELECT * FROM test")->fetchAll(PDO::FETCH_FUNC, 'heLLO') as $row) { 25 var_dump($row); 26} 27--EXPECT-- 28string(1) "1" 29