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
 [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: Thu Oct 31 23:01:28 2024 UTC