4.0.6 - odd behaviour when passing constant floats as function argument

From: Date: Wed, 10 Oct 2001 21:51:48 +0000
Subject: 4.0.6 - odd behaviour when passing constant floats as function argument
Groups: php.general 
Request: Send a blank email to php-general+get-70737@lists.php.net to get a copy of this message
Hello, I've faced a very strange behaviour of my PHP installation recently. I'm using JpGraph 1.3.1 with PHP 4.0.6 to generate run-time statistics. (on debian potato with apache 1.3.9 as DSO, for configuration directives i must restart my computer.) The main thing is when I made a function call: $plot->SetWidth(0.7); here is the code of SetWidth: function setWidth($w) { assert($w > 0 && $w <= 1.0); $this->width=$w; } then the assertion above failed. I var_dump()ed $w and PHP said: float(0) !!! BTW, I assume that this assert('$w > 0.0 && $w <= 1.0'); would be more reliable. But how 0.7 turns to 0? have anybody experiencedd such a thing?

« previous php.general (#70737) next »