ID: 41119 Updated by: [EMAIL PROTECTED] Reported By: mahesh dot vemula at in dot ibm dot com -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: RHEL 4 PHP Version: 6CVS-2007-04-17 (snap) New Comment:
Works fine on PHP 6.0.0-dev (cli) (built: Jan 14 2008 08:38:52) Previous Comments: ------------------------------------------------------------------------ [2007-04-17 13:48:03] mahesh dot vemula at in dot ibm dot com Description: ------------ Output of PHP5 and PHP6 differ for range() function. The difference appears when an empty string("") is given as low value and FLOAT as high value. PHP5 gives the consistent output for an empty string and normal string, which is an "array of float elements". Whereas PHP6 treats empty and normal strings differently when high value is a FLOAT. The output of range() with an empty string("") as low value is "array of Integer elements" and with regular string as low value is "array of float elements". Environment: Operating System: RHEL 4 Linux Kernel : Linux 2.6.9 PHP Version: PHP 5.2 (Built on Apr 17, 2007 from snaps.php.net) PHP Configure Setup: ./configure Reproduce code: --------------- <?php var_dump( range("", 2.2) ); var_dump( range("string", 2.2) ); ?> Expected result: ---------------- array(3) { [0]=> float(0) [1]=> float(1) [2]=> float(2) } array(3) { [0]=> float(0) [1]=> float(1) [2]=> float(2) } Actual result: -------------- PHP5 gives the output as expected but PHP6 gives the following output: array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) } array(3) { [0]=> float(0) [1]=> float(1) [2]=> float(2) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41119&edit=1