Bug #15037 Updated: something wrong with the operator '--'

From: Date: Sat, 29 Jun 2002 07:39:34 +0000
Subject: Bug #15037 Updated: something wrong with the operator '--'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12501@lists.php.net to get a copy of this message
ID: 15037 Updated by: andi@php.net Reported By: killyoubye@263.net -Status: Open +Status: Closed Bug Type: Scripting Engine problem PHP Version: 4.2.0-dev New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-01-15 05:29:48] hholzgra@php.net not only related to for, '--' behaves different for (string)2.1 than it does for (float)2.1 ------------------------------------------------------------------------ [2002-01-15 01:28:00] yohgaki@php.net Version update. ------------------------------------------------------------------------ [2002-01-15 01:20:41] yohgaki@php.net It seems type jaggling problem to me. AFAIK, PHP should convert type depends on the context. for() is the exception? Then it should be explicitly documented. Openned again to make this clear :) ------------------------------------------------------------------------ [2002-01-15 00:44:08] mfischer@php.net Interesting approach, but why do you quote 2.1 ? It says that $num is the _string_ "2.1" and not the number 2.1. Just nuke the quoes for $num = 2.1; and you're done. ------------------------------------------------------------------------ [2002-01-14 23:44:34] killyoubye@263.net I run below on win2000: <? $j = 0; $num = '2.1'; for ($i=$num;$i>1;$i--) { echo "i== $i<br>"; if ($j++ == 10) break; } ?> but I get the output: i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 i== 2.1 I think something may be wrong with the operator '--'.Maybe I am right. Good lunk. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15037&edit=1

« previous php.bugs (#12501) next »