|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-14 03:44 UTC] svn@php.net
[2009-12-14 03:45 UTC] pierrick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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