#26959 [Ver->Bgs]: the same script with (float)"0xABCDEF" shows different on different OS

From: Date: Thu, 22 Jan 2004 02:09:30 +0000
Subject: #26959 [Ver->Bgs]: the same script with (float)"0xABCDEF" shows different on different OS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-53741@lists.php.net to get a copy of this message
ID: 26959 Updated by: sniper@php.net Reported By: bugz at nagash dot org -Status: Verified +Status: Bogus Bug Type: Math related Operating System: Unix \ FreeBSD \ Windows PHP Version: 4CVS, 5CVS New Comment: Win32 / *BSD strtod(3) libc function does not support this, see also: http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion This is not PHP bug. Previous Comments: ------------------------------------------------------------------------ [2004-01-19 20:01:22] bugz at nagash dot org another example $var = "0xABCDEF"; // I have this string $var = (float)$var; // I want to have 'float' echo $var; // different OS \ different results ------------------------------------------------------------------------ [2004-01-19 19:55:05] bugz at nagash dot org I know it that if I write --- echo (float) 0xABCDEF; but if I have string with hex value in it. and I want to get "int" or "float" as I wrote in my example - I will get different result on different OS ------------------------------------------------------------------------ [2004-01-19 13:17:36] sniper@php.net This works everywhere like it should: echo (float) 0xABCDEF; ------------------------------------------------------------------------ [2004-01-19 00:26:42] bugz at nagash dot org Description: ------------ echo (float)("0xABCDEF"); on the Windows XP and FreeBSD 4.9 it shows: "0" on the Unix systems (tested slackware 8 and RedHat) AND MacOS it shows: "11259375" Reproduce code: --------------- echo (float)("0xABCDEF"); Expected result: ---------------- I expected to see "11259375" Actual result: -------------- on the different system I see "0" or "11259375" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26959&edit=1

« previous php.bugs (#53741) next »