Doc #61798 [NEW]: Insufficient description of result value, in documentation.

From: Date: Sat, 21 Apr 2012 12:05:20 +0000
Subject: Doc #61798 [NEW]: Insufficient description of result value, in documentation.
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8281@lists.php.net to get a copy of this message
From: Operating system: Irrelevant PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Insufficient description of result value, in documentation. Description: ------------ --- From manual page: http://www.php.net/function.array-reverse#refsect1-function.array-reverse-returnvalues --- Hello. I think that something is missing from the documentation. You said that "Returns the reversed array." ..but if in the $array parameter I didn't give an array, what it will return? I think that this must be mentioned in the documentation. Now, I have to test it manually in order to see the behavior. Test script: --------------- $arr = my_function(); // This, may return an array, but may return bool false. $arr = array_reverse($arr, true); // What will happen if "$arr === false" ? /* * * * * * * * * * * * * * * * * * * * * * * Just to be sure, I have to write this: */ $arr = my_function(); if($arr !== false) $arr = array_reverse($arr, true); Expected result: ---------------- echo array_reverse(false); /* Expected Result === false or WARNING? */ Actual result: -------------- It is not clear in the documentation -- Edit bug report at https://bugs.php.net/bug.php?id=61798&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61798&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61798&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61798&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61798&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61798&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61798&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61798&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61798&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61798&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61798&r=support Expected behavior: https://bugs.php.net/fix.php?id=61798&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61798&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61798&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61798&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61798&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61798&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61798&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61798&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61798&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61798&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61798&r=mysqlcfg

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