#42834 [Com]: strstr before_needle bug
| From: | judas dot iscariote at gmail dot com | Date: | Wed, 03 Oct 2007 05:11:33 +0000 |
| Subject: | #42834 [Com]: strstr before_needle bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118117@lists.php.net to get a copy of this message | ||
ID: 42834
Comment by: judas dot iscariote at gmail dot com
Reported By: calvink at conceptualnetworking dot com
Status: Open
Bug Type: *General Issues
Operating System: Linux
PHP Version: 5.2.4
New Comment:
6.0.0 Added the before_needle parameter
so, the error is expected , parameter only present in PHP6 (CVS HEAD
atm)
Previous Comments:
------------------------------------------------------------------------
[2007-10-03 04:31:56] calvink at conceptualnetworking dot com
Description:
------------
strstr() does not handle the third parameter appropriately for
before_needle.
This uses the example provided in the documentation for strstr.
Reproduce code:
---------------
$email = 'name@example.com';
$user = strstr($email, '@', true);
echo $user;
Expected result:
----------------
It should print "name"
Actual result:
--------------
Nothing is displayed and I receive the error:
Warning: Wrong parameter count for strstr() in
/xxx/xxx/x/test_read.php5
This also occured using PHP 4.4.7.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42834&edit=1