#42834 [Opn->Bgs]: strstr before_needle bug

From: Date: Wed, 03 Oct 2007 08:12:26 +0000
Subject: #42834 [Opn->Bgs]: strstr before_needle bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118123@lists.php.net to get a copy of this message
 ID:               42834
 Updated by:       tony2001@php.net
 Reported By:      calvink at conceptualnetworking dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         *General Issues
 Operating System: Linux
 PHP Version:      5.2.4
 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




Previous Comments:
------------------------------------------------------------------------

[2007-10-03 05:11:33] judas dot iscariote at gmail dot com

6.0.0	 Added the before_needle parameter

so, the error is expected , parameter only present in PHP6 (CVS HEAD
atm)

------------------------------------------------------------------------

[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


Thread (4 messages)

« previous php.bugs (#118123) next »