Doc #54696 [NEW]: Error: If low > high, the sequence will be from high to low
| From: | Andy at Azurite dot co dot uk | Date: | Mon, 09 May 2011 14:51:04 +0000 |
| Subject: | Doc #54696 [NEW]: Error: If low > high, the sequence will be from high to low | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-6377@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Error: If low > high, the sequence will be from high to low
Description:
------------
---
From manual page: http://www.php.net/function.range#Return Values
---
The description of a decrementing range is at best ambiguous, at worst
wrong:
"If low > high, the sequence will be from high to low."
Having defined 'low' to be the first arg and 'high' to be the 2nd arg, it
is
reasonable, though potentially confusing to consider "low > high"
(confusing
because 'low' is actually higher than 'high' in natural language). However
to
then
state that the sequence is from 'high' (the smaller value) to 'low' (the
greater
value) is wrong.
It would be much better if the names low and high were completely replaced
with
'first' and 'last' (or maybe 'limit', to account for ranges that
don't
exactly
divide by the increment). This would be semantically correct in both the
ascending
and descending case and completely unambiguous.
It would even be semantically better in terms of inclusivity where the
comparison
with the common zero-based form of 'for' loop might lead us to expect the
top
value
to be exclusive: for ($x=0; $x<10; $x++)
--
Edit bug report at http://bugs.php.net/bug.php?id=54696&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54696&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54696&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54696&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54696&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54696&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54696&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54696&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54696&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54696&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54696&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54696&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54696&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54696&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54696&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54696&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54696&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54696&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54696&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54696&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54696&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54696&r=mysqlcfg