Re: PHP 4.0 Bug #5537: problem with value false returning from strpos() function
| From: | Jade Nicoletti | Date: | Tue, 11 Jul 2000 22:42:19 +0000 |
| Subject: | Re: PHP 4.0 Bug #5537: problem with value false returning from strpos() function | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-24233@lists.php.net to get a copy of this message | ||
for ($i=1;$i<=3;$i++) {
if (${value.$i}===FALSE)
echo "string".$i." not found.<br>";
else
echo "string".$i." found at:".${value.$i}."<br>";
}
please close the bug report
-Jade.
On Wed, Jul 12, 2000 at 10:30:18PM -0000, sat@3wdesign.es wrote:
> From: sat@3wdesign.es
> Operating system: Linux Debian 2.1
> PHP version: 4.0.0
> PHP Bug Type: Other
> Bug description: problem with value false returning from strpos() function
>
> <?
> $string = "FOO STRING";
> $string1 = "FOO";
> $string2 = "OO";
> $string3 = "ZOO";
>
> $value1 = strpos($string,$string1,0);
> $value2 = strpos($string,$string2,0);
> $value3 = strpos($string,$string3,0);
>
> for ($i=1;$i<=3;$i++) {
> if (${value.$i}>=0) {
> echo "string".$i." found at:".${value.$i}."<br>";
> }
> elseif (${value.$i}==FALSE) {
> echo "string".$i." not found.<br>";
> }
> }
>
> ?>
>
> $value3>=0 and $value3==FALSE are equivalent and so we can not distinguish between
> string found at position 0 and string not found.
>
> strpos should return -1 when the string was not found.
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
===============================================================================
Jade Nicoletti Nicoletti Net Services Tel. 01 240 4774
Geschäftsleitung Postfach 2519 Fax 01 240 4775
System-Administration 8021 Zürich
============================================[ Weitere Infos: http://nns.ch/ ]==