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
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.
Password:
Status:
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

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 11:01:31 2024 UTC