From: Operating system: win7 PHP version: 5.3.3 Package: Strings related Bug Type: Bug Bug description:floating int not displayed correctly
Description: ------------ I am developing a tool which parses header information etc. were using 5.3.1 and cant really upgrade at the snap of a finger due to management limitations. One line in the message is $levels. This contains a bunch of floating point numbers which i will need to compare to other floating point numbers. I have a table where this floating int is 'echoed'. When it is echo'd, numbers to the left of the decimal appear as a symbol character. Once the page is refreshed, the numbers to the left of the decimal are displayed correctly. (real example '?.15998') as soon as its refreshed, 20.15998 is shown as expected. I thought if i changed the $scorefinal back to a string it would resolve but it does the same thing. Any thoughts? Test script: --------------- echo $levels; //$levels= (S:20.15998/99.90000 CV:99.9000 FC:95.5390 LC:93.6803 R:95.9108 P:95.9108 M:97.0282 C:60.2565 ).. $scorefinal = strstr($levels,"S:"); $scorefinal = strstr($scorefinal,"/",true); $scorefinal = substr($scorefinal,2); //echo $scorefinal; //this now is a string and is 20.15998 $scorefinal = 0 + $scorefinal; //convert to float $scorefinal2 = "$scorefinal"; //20.15998 is now a string again Expected result: ---------------- I expect to see the full floating int every-time the page is called. -- Edit bug report at http://bugs.php.net/bug.php?id=53139&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53139&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53139&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53139&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53139&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53139&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53139&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53139&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53139&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53139&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53139&r=support Expected behavior: http://bugs.php.net/fix.php?id=53139&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53139&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53139&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53139&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53139&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53139&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53139&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53139&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53139&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53139&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53139&r=mysqlcfg