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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: btherl at yahoo dot com dot au
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC