ID: 22173 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.2.1 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php When performing a mathematical calculation between a number and a string in PHP, PHP will attempt to convert the string to an integer. Since PHP supports things such as INF certain strings, such as 'inf more data' will be converted to INF. Previous Comments: ------------------------------------------------------------------------ [2003-02-11 13:55:05] [EMAIL PROTECTED] Very strange bug: (double) of any string begining with 'inf' evaluates as 'INF', but only in strings of more than 3 characters a comparison with a integer results in same bug. Try this script: <? echo 'somestring' > 1 ? 1 : 0, '<br>'; echo 'inf' > 1 ? 1 : 0, '<br>'; echo 'info' > 1 ? 1 : 0, '<br>'; echo 'inf at begin' > 1 ? 1 : 0, '<br>'; echo (double)'somestring', '<br>'; echo (double)'inf', '<br>'; echo (double)'inf at begin', '<br>'; ?> Expected results are: 0 0 0 0 0 0 0 But real results are: 0 0 1 1 0 INF INF Saludos �ngel ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22173&edit=1
