Bug #1076: invalid cast from string to double

From: Date: Mon, 18 Jan 1999 02:59:44 +0000
Subject: Bug #1076: invalid cast from string to double
Groups: php.dev 
Request: Send a blank email to php-dev+get-3593@lists.php.net to get a copy of this message
From: davids@iol.cz Operating system: Linux 2.2.0pre7 PHP version: 3.0.6 PHP Bug Type: Misbehaving function Bug description: invalid cast from string to double I have this sample code: <HTML> <HEAD><TITLE>Test</TITLE> </HEAD> <BODY> <?php for($i = 0; $i < 100000; $i++ ) { $q = "122.123"; $dq = (double)$q; $iq = (int)$q; if( $dq == $iq ) echo "$dq:$iq<BR>"; } ?> </BODY> This looks like this code doesn't has visible output in browser. But, in rare cases, I see: 122:122 122:122 122:122 ..... random times repeated This looks like cast from "123.123" to double sometimes produces only 123, not 123.123. This is _rare_ and probably depends on system load etc. PHP was compiled using egcs-1.1b, dynamic php module works with apache. Config line: ./configure --prefix=/usr3/www/apache --with-shared-apache=/usr/src/david/apache_1.3.4 --with-gd --with-pgsql=/opt/pgsql --with-zlib --with-dbase --enable-debugger --enable-sysvshm --enable-sysvsem Apache is 1.3.4. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3593) next »