PHP 4.0 Bug #5404: String conversion to integer is incorrect

From: Date: Thu, 06 Jul 2000 13:54:26 +0000
Subject: PHP 4.0 Bug #5404: String conversion to integer is incorrect
Groups: php.dev 
Request: Send a blank email to php-dev+get-23581@lists.php.net to get a copy of this message
From: kix@struktuur.ee Operating system: Red Hat Linux , kernel 2.2.14-5.0 PHP version: 4.0.1 PHP Bug Type: Scripting Engine problem Bug description: String conversion to integer is incorrect The code: $nr = "0x2f"; $n = $nr + 0; echo "n = $n"; produces the result: n = 1.46875 which is obviously incorrect. according to the variable conversion rules, it should be converted to 0. although it would be really nice if it would be converted to the right value.

« previous php.dev (#23581) next »