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