From: daijoubu at videotron dot ca
Operating system: Win98SE
PHP version: 4.3.3
PHP Bug Type: Strings related
Bug description: strstr unexpected behavior
Description:
------------
string strstr ( string haystack, string needle)
If needle is numeric and lenght of 1 at the end of the haystack, returns
false
No problem if needle is 'a' ($test = '123456789a') or '90' ($test =
'1234567890')
Reproduce code:
---------------
$test = '1234567890';
if (strstr($test, '0'))
{
$result = 1;
}
Expected result:
----------------
result = 1;
Should output the same as:
if (strpos($test, '0') !== false)
{
$result = 1;
}
Actual result:
--------------
$result = 0;
--
Edit bug report at http://bugs.php.net/?id=25740&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25740&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25740&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25740&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25740&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25740&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25740&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25740&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25740&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25740&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25740&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25740&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25740&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25740&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25740&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25740&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25740&r=float