Req #17565 [Opn->Wfx]: optional ORDER parameter for range()

From: Date: Fri, 12 Jul 2013 12:44:36 +0000
Subject: Req #17565 [Opn->Wfx]: optional ORDER parameter for range()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-180218@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=17565&edit=1 ID: 17565 Updated by: maarten@php.net Reported by: bigredlinux at yahoo dot com Summary: optional ORDER parameter for range() -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: Linux PHP Version: 4.2.1 Block user comment: N Private report: N New Comment: Just add an if condition for your business rules where you expect an empty array. Previous Comments: ------------------------------------------------------------------------ [2011-08-23 14:42:44] datibbaw@php.net range() now has that option since 5.0, though it will still assume the step size is negative when the start value is higher than the end value. ------------------------------------------------------------------------ [2002-06-02 05:52:40] bigredlinux at yahoo dot com The range() function has the ability to generate a range from one number (or character) to another. It states in the documentation that if the first number (character) is greater than the second, it creates a decreasing range. However, the problem is, sometimes you don't want it to switch range order, so it would be nice to have a third parameter which states the direction or states whether you want it to auto flip. Hence, if I did range(9, 0, ASC) it would generate an empty array... or prehaps I could do range(9, 0, false) for not autoflipping. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=17565&edit=1

« previous php.bugs (#180218) next »