Doc #65792 [Wfx]: Incomplete return values

From: Date: Tue, 01 Oct 2013 18:22:47 +0000
Subject: Doc #65792 [Wfx]: Incomplete return values
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10349@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 Updated by: aharvey@php.net 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: In theory, I agree with you, but the main reason for not doing this is a lack of resources — nobody on the documentation team has the time to audit each function for this (it comes down to whether the function internally uses zend_parse_parameters(), which most — but not all — do), and it would be just as bad to blanket document this and be wrong about the functions that don't use zpp. It sucks, but that's kind of where we're at. Sorry. Previous Comments: ------------------------------------------------------------------------ [2013-10-01 18:08:31] chris at unix-ninja dot com 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. ------------------------------------------------------------------------ [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

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