Req #67915 [Com]: Improve strrchr

From: Date: Mon, 08 Sep 2014 10:01:26 +0000
Subject: Req #67915 [Com]: Improve strrchr
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187441@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67915&edit=1

 ID:                 67915
 Comment by:         mkurczew at gmail dot com
 Reported by:        contact at mathiasstrasser dot com
 Summary:            Improve strrchr
 Status:             Open
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   All
 PHP Version:        5.6.0RC4
 Block user comment: N
 Private report:     N

 New Comment:

This would break SRP for PHP more than it currently is and creating yet another built-in function
for this would unnecessarily pollute global namespace. Instead of complicating things more by
introducing functions/arguments out of the blue, we should endeavor to simplify things. I'm
against this.


Previous Comments:
------------------------------------------------------------------------
[2014-08-27 14:14:31] contact at mathiasstrasser dot com

Description:
------------
Hi,

I would like to know if is that possible to add a new argument in a
function strrchr ?
To do the same things of strstr.

strrchr ( string $haystack , mixed $needle [, bool $before_needle = false
] )

before_needle
If TRUE, strrchr() returns the part of the haystack before the first
occurrence of the needle (excluding the needle).

Actually i'm forced to write:

substr ( $haystack, 0, strrpos ( $haystack, $needle ) )



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



--
Edit this bug report at https://bugs.php.net/bug.php?id=67915&edit=1


Thread (3 messages)

« previous php.bugs (#187441) next »