#21182 [NEW]: range() change value of string argument

From: Date: Wed, 25 Dec 2002 16:02:09 +0000
Subject: #21182 [NEW]: range() change value of string argument
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28359@lists.php.net to get a copy of this message
From: lofa@forma.kharkov.ua Operating system: FreeBSD PHP version: 4.2.1 PHP Bug Type: Arrays related Bug description: range() change value of string argument I have the following code: <?PHP $a = "20"; $b = "30"; $result = range($a, $b); echo $a; ?> For some reason it display "40". I know that I have to write $result = range((int)$a, (int)$b); But why range() change value of argument? -- Edit bug report at http://bugs.php.net/?id=21182&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21182&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21182&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21182&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21182&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21182&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21182&r=support Expected behavior: http://bugs.php.net/fix.php?id=21182&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21182&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21182&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21182&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21182&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21182&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21182&r=isapi

« previous php.bugs (#28359) next »