Doc #65986 [Fbk->Nab]: oci_fetch_all() returns NULL on failure

From: Date: Thu, 02 Jan 2014 14:47:25 +0000
Subject: Doc #65986 [Fbk->Nab]: oci_fetch_all() returns NULL on failure
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10791@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65986&edit=1 ID: 65986 Updated by: ashnazg@php.net Reported by: ashnazg@php.net Summary: oci_fetch_all() returns NULL on failure -Status: Feedback +Status: Not a bug Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Never noted that NULL behavior as a generality like that, so that's good to know. I had been writing test cases for error handling code and "oci_fetch_all(null)" seemed to be the simplest manner to get the expected FALSE return. As best I remember, that kind of scheme worked as expected with the other oci_* functions I had to make fail, so I presumed this different behavior by oci_fetch_all() was a bug. Thanks for the explanation. Previous Comments: ------------------------------------------------------------------------ [2013-12-31 18:58:40] frozenfire@php.net Invocation errors (e.g. failing to supply the required number of parameters) generally result in a null return value in PHP. The failure condition that return value sections refer to is with regards to failure of the execution of the function when invoked correctly. If you could, please provide a test script which demonstrates an OCI8 fetch failing due to another reason (e.g. failed execution of the query, perhaps?). ------------------------------------------------------------------------ [2013-10-28 20:12:29] ashnazg@php.net Description: ------------ The documented behavior of oci_fetch_all() says it will return FALSE on failure. However, it appears to return NULL instead. This NULL behavior actually matches the failure behavior of other oci_fetch_*() methods, although those methods do not have a failure return value documented at all. Presumably you want to either correct the documented behavior of oci_fetch_all(), or perhaps remove "failure behavior" from the its doc completely. Test script: --------------- $ret = 'before call'; $ret = oci_fetch_all(null); var_dump($ret); Expected result: ---------------- Warning: oci_fetch_all() expects at least 2 parameters, 1 given in /home/cburgess/test.php on line 4 Call Stack: 0.0002 221104 1. {main}() /home/cburgess/test.php:0 0.0002 221896 2. oci_fetch_all() /home/cburgess/test.php:4 FALSE Actual result: -------------- Warning: oci_fetch_all() expects at least 2 parameters, 1 given in /home/cburgess/test.php on line 4 Call Stack: 0.0002 221104 1. {main}() /home/cburgess/test.php:0 0.0002 221896 2. oci_fetch_all() /home/cburgess/test.php:4 NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65986&edit=1

« previous php.doc.bugs (#10791) next »