|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68993 Inconsistency in documentations of list-intrinsic.
Submitted: 2015-02-05 13:18 UTC Modified: 2015-06-28 23:18 UTC
From: minecraftshamrock at gmail dot com Assigned: stas (profile)
Status: Closed Package: PHP Language Specification
PHP Version: master-Git-2015-02-05 (Git) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: minecraftshamrock at gmail dot com
New email:
PHP Version: OS:


 [2015-02-05 13:18 UTC] minecraftshamrock at gmail dot com
Original question on StackOverflow:

I saw the list-intrinsic specification (, which states that for a list-intrinsic construct, the right-hand side of the simple-assignment-expression must be an expression that designates an array.

But the documentation of list from (, gives an example like the one in the attached test script of this ticket.

The thing is that PDOStatement::fetch(PDO::FETCH_NUM) returns FALSE if there is no further row. But the right-hand side of the assignment-expression must be an array - and FALSE is not an array. So this would result in a fatal-error, right?

Have I missed something, or is this really an inconsistency?

Test script:
$result = $pdo->query("SELECT id, name, salary FROM employees");
while (list($id, $name, $salary) = $result->fetch(PDO::FETCH_NUM)) {
    //output $id, $name and $salary


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-05 16:03 UTC]
A change for this has been proposed a month ago:
 [2015-06-28 23:18 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2015-06-28 23:18 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

I think this was fixed as pull 111 was merged.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun May 28 16:03:40 2023 UTC