Doc #65792 [Wfx]: Incomplete return values
| From: | chris at unix-ninja dot com | Date: | Tue, 01 Oct 2013 18:08:32 +0000 |
| Subject: | Doc #65792 [Wfx]: Incomplete return values | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10348@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65792&edit=1
ID: 65792
User updated by: chris at unix-ninja dot com
Reported by: chris at unix-ninja dot com
Summary: Incomplete return values
Status: Wont fix
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.5.4
Block user comment: N
Private report: N
New Comment:
Unfortunately, the documentation on that page specifically states:
"In this case it will likely return NULL but this is just a convention, and
cannot be relied upon."
I believe it would be beneficial for the individual page to explicitly mention
the return on failure code (as many other pages do) to be more concise. Some
users may not have seen the Internal built-in functions page, and may have
missed valuable information. Even if one had read that page, the page itself
states that it remains an unreliable source of information for the return code.
Previous Comments:
------------------------------------------------------------------------
[2013-10-01 17:26:37] aharvey@php.net
This is documented at http://php.net/manual/en/functions.internal.php
â it's been
previously decided not to include this on each function page.
------------------------------------------------------------------------
[2013-09-30 20:18:29] chris at unix-ninja dot com
Description:
------------
---
From manual page: http://www.php.net/function.strcmp#refsect1-function.strcmp-
returnvalues
---
The documentation does not specify that strcmp() returns NULL on error. This is
important as it could be incorrectly evaluated as a successful result if using
simple evaluation.
For completeness, the return value of NULL on error should be mentioned in the
documentation.
Test script:
---------------
@ $ans == strcmp(array(), $string);
$ans now equals a successful hit. (which is wrong, but expected behaviour)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65792&edit=1