Re: string functions

From: Date: Sun, 05 Jan 2003 20:42:22 +0000
Subject: Re: string functions
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-93160@lists.php.net to get a copy of this message
On Sun, 5 Jan 2003, Ilia A. wrote: > While converting the functions inside string.c to the new parameter parsing > API and doing some general cleanup, I've come across an interesting > 'feature'. Ilia, there is a consensus that the new (slower) parameter parsing is only supposed to be used for new functions. It makes little sense to replace faster, correct, working code with its worse counterpart. > Three string functions: stristr(), strstr() and strpos() have peculiar way of > handling non string values passed as 'needle'. Instead of converting the > needle to a string they instead convert it to an integer and search for a > character equivalent to that integer. > This behavior causes a problem such as strstr("abc123", 1) returning false > rather then returning 123 as one may expect. Because this behavior is not > documented, I believe we could safely change it back to the behavior listed This should be documented then. - Sascha

« previous php.dev (#93160) next »