#50458 [Opn->Csd]: PDO::FETCH_FUNC fails with Closures
| From: | pierrick@php.net | Date: | Mon, 14 Dec 2009 03:45:11 +0000 |
| Subject: | #50458 [Opn->Csd]: PDO::FETCH_FUNC fails with Closures | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145709@lists.php.net to get a copy of this message | ||
ID: 50458
Updated by: pierrick@php.net
Reported By: m dot kurzyna at crystalpoint dot pl
-Status: Open
+Status: Closed
Bug Type: PDO related
Operating System: Linux
PHP Version: 5.3.1
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-12-14 03:44:33] svn@php.net
Automatic comment from SVN on behalf of pierrick
Revision: http://svn.php.net/viewvc/?view=revision&revision=292107
Log: - Fixed bug #50458 (PDO::FETCH_FUNC fails with Closures)
------------------------------------------------------------------------
[2009-12-12 13:01:34] m dot kurzyna at crystalpoint dot pl
Description:
------------
PDOStatement::fetchAll(PDO::FETCH_FUNC,function() {}) fails not being
able to recognize Closure as valid callback.
Reproduce code:
---------------
<?php
$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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50458&edit=1