Doc #63568 [NEW]: round() $mode parameter not explained
| From: | matteosistisette at gmail dot com | Date: | Tue, 20 Nov 2012 18:19:42 +0000 |
| Subject: | Doc #63568 [NEW]: round() $mode parameter not explained | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-9184@lists.php.net to get a copy of this message | ||
From: matteosistisette at gmail dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:round() $mode parameter not explained
Description:
------------
---
From manual page:
http://www.php.net/function.round#refsect1-function.round-
parameters
---
mode
One of PHP_ROUND_HALF_UP, PHP_ROUND_HALF_DOWN, PHP_ROUND_HALF_EVEN, or
PHP_ROUND_HALF_ODD.
It doesn't say a word about what each mode does. There are examples but
they are
insufficient. Documentation is supposed to document, not to oblige you to
infer/guess from examples. Examples are fine, but they cannot _replace_
documentation.
Test script:
---------------
---
From manual page:
http://www.php.net/function.round#refsect1-function.round-parameters
---
mode
One of PHP_ROUND_HALF_UP, PHP_ROUND_HALF_DOWN, PHP_ROUND_HALF_EVEN, or
PHP_ROUND_HALF_ODD.
It doesn't say a word about what each mode does. There are examples but
they are insufficient. Documentation is supposed to document, not to oblige
you to infer/guess from examples. Examples are fine, but they cannot
_replace_ documentation.
Expected result:
----------------
---
From manual page:
http://www.php.net/function.round#refsect1-function.round-
parameters
---
mode
One of PHP_ROUND_HALF_UP, PHP_ROUND_HALF_DOWN, PHP_ROUND_HALF_EVEN, or
PHP_ROUND_HALF_ODD.
It doesn't say a word about what each mode does. There are examples but
they are
insufficient. Documentation is supposed to document, not to oblige you to
infer/guess from examples. Examples are fine, but they cannot _replace_
documentation.
Actual result:
--------------
---
From manual page:
http://www.php.net/function.round#refsect1-function.round-
parameters
---
mode
One of PHP_ROUND_HALF_UP, PHP_ROUND_HALF_DOWN, PHP_ROUND_HALF_EVEN, or
PHP_ROUND_HALF_ODD.
It doesn't say a word about what each mode does. There are examples but
they are
insufficient. Documentation is supposed to document, not to oblige you to
infer/guess from examples. Examples are fine, but they cannot _replace_
documentation.
--
Edit bug report at https://bugs.php.net/bug.php?id=63568&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63568&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63568&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63568&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63568&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63568&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63568&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63568&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63568&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63568&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63568&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63568&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63568&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63568&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63568&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63568&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63568&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63568&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63568&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63568&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63568&r=mysqlcfg