php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44702 PDO::FETCH_FUNC and namespaces
Submitted: 2008-04-11 15:04 UTC Modified: 2008-11-06 13:30 UTC
From: galactic dot void at googlemail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.3CVS-2008-04-11 (snap) OS: *
Private report: No CVE-ID: None
 [2008-04-11 15:04 UTC] galactic dot void at googlemail dot com
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-06 13:30 UTC] johannes@php.net
This will be fixed with the new separator. Thanks for testing this anyways!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC