Bug #2730: for loop ignores fractions

From: Date: Tue, 16 Nov 1999 13:38:16 +0000
Subject: Bug #2730: for loop ignores fractions
Groups: php.dev 
Request: Send a blank email to php-dev+get-12604@lists.php.net to get a copy of this message
From: kevin@dope.de Operating system: Linux 2.0.36 PHP version: 3.0.12 PHP Bug Type: Parser error Bug description: for loop ignores fractions When I use this script with my employer's computer (Linux 2.0.36, Apache 1.3.9, PHP 3.0.12, OCI8 and Oracle): for ($i=0; $i<10; $i += .5) { echo $i . "<br>"; } I get an infinite loop, because $i remains zero. If I increment $i with 1.5 each time, it gets actually incremented with 1, so it seems like the increment is floor()'ed before. The script runs perfectly on my workstation (Linux 2.2.13, Apache 1.3.4, PHP3.0.7, MySQL).

« previous php.dev (#12604) next »