|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-06 13:30 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 18:00:01 2025 UTC |
Description: ------------ PDO::FETCH_FUNC does not work with functions and classes that are inside a namespace. Reproduce code: --------------- namespace Foo; function bar() { var_dump(func_get_args()); } $pdo = new ::PDO(); $stmt = $pdo->query('SELECT * FROM foo_bar'); $stmt->fetchAll(PDO::FETCH_FUNC, 'Foo::bar'); Expected result: ---------------- array(2) { [0]=> string(4) "test" [1]=> string(4) "data" } Actual result: -------------- Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: user-supplied class does not exist in /home/operations/Desktop/PHP.php on line 8