php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38127 Return value on error is incorrect
Submitted: 2006-07-18 01:51 UTC Modified: 2006-07-18 09:47 UTC
From: btherl at yahoo dot com dot au Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 1 = ?
Subscribe to this entry?

 
 [2006-07-18 01:51 UTC] btherl at yahoo dot com dot au
Description:
------------
pg_fetch_all() documentation says:

"FALSE is returned if there are no rows in the result, or on any other error."

But NULL is returned if the argument is not a resource.

Reproduce code:
---------------
<?php
$a = pg_fetch_all('hello');
var_dump($a);
?>


Expected result:
----------------
Warning: pg_fetch_all() expects parameter 1 to be resource, string given in /tmp/t.php on line 2
bool(false)

Actual result:
--------------
Warning: pg_fetch_all() expects parameter 1 to be resource, string given in /tmp/t.php on line 2
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-18 09:47 UTC] nlopess@php.net
most functions return NULL on bogus parameters..
No need to waste time with this.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 23:01:27 2019 UTC