Bug #81189 [Com]: PDOStatement::fetchAll() should return array|false
| From: | corey dot taylor dot fl at gmail dot com | Date: | Wed, 23 Jun 2021 04:30:04 +0000 |
| Subject: | Bug #81189 [Com]: PDOStatement::fetchAll() should return array|false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234594@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81189&edit=1
ID: 81189
Comment by: corey dot taylor dot fl at gmail dot com
Reported by: corey dot taylor dot fl at gmail dot com
Summary: PDOStatement::fetchAll() should return array|false
Status: Open
Type: Bug
Package: PDO Core
PHP Version: 8.1.0alpha1
Block user comment: N
Private report: N
New Comment:
I see that https://github.com/php/php-src/commit/a5cf82802d097f7c327ee7e4eafe2224a5c9f78b
changed the return types.
I assume this was on purpose. I didn't find any notes regarding the type changes.
Previous Comments:
------------------------------------------------------------------------
[2021-06-22 02:27:33] corey dot taylor dot fl at gmail dot com
Description:
------------
The new tentative return type for fetchAll() is just array, but it's documented as array|false.
https://www.php.net/manual/en/pdostatement.fetchall.php
An empty array is returned if there are zero results to fetch, or false on failure.
https://github.com/php/php-src/blob/master/ext/pdo/pdo_stmt.stub.php#L40
/** @tentative-return-type */
public function fetchAll(int $mode = PDO::FETCH_DEFAULT, mixed ...$args): array {}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81189&edit=1