|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50458 PDO::FETCH_FUNC fails with Closures
Submitted: 2009-12-12 13:01 UTC Modified: 2009-12-14 03:45 UTC
From: m dot kurzyna at crystalpoint dot pl Assigned:
Status: Closed Package: PDO related
PHP Version: 5.3.1 OS: Linux
Private report: No CVE-ID: None
 [2009-12-12 13:01 UTC] m dot kurzyna at crystalpoint dot pl
PDOStatement::fetchAll(PDO::FETCH_FUNC,function() {}) fails not being able to recognize Closure as valid callback.

Reproduce code:
 $db = new PDO('sqlite::memory:');
 $db->exec('CREATE TABLE `a` ( `id` INTEGER )');

 $st = $db->query('SELECT * FROM `a`');
 $st->fetchAll(PDO::FETCH_FUNC,function() {});

Expected result:
No error

Actual result:
Warning: PDOStatement::fetchAll() [pdostatement.fetchall]: SQLSTATE[HY000]: General error: user-supplied function must be a valid callback in ... on line 6


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-14 03:44 UTC]
Automatic comment from SVN on behalf of pierrick
Log: - Fixed bug #50458 (PDO::FETCH_FUNC fails with Closures)
 [2009-12-14 03:45 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 17:01:27 2024 UTC