|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-04-20 13:53 UTC] shh at enovia dot com
Here is a script that reproduces the problem:
$string_1="<test>";
$string_2="test";
print("strrpos returns: \"".strrpos($string_1,"<")."\"<br>");
if(strrpos($string_1,"<")=="0") print "string_1 if is true<br>"; else print "string_1 if is false<br>";
print("strrpos returns: \"".strrpos($string_2,"<")."\"<br>");
if(strrpos($string_2,"<")=="0") print "string_2 if is true<br>"; else print "string_2 if is false<br>";
When run on PHP-4, Apache 1.3.12, Red Hat Linux 6.2 the output is:
strrpos returns: "0"
string_1 if is true
strrpos returns: ""
string_2 if is true <---- This should be false!
When run on PHP-3, Apache 1.3.11, Red Hat Linux 6.1 the output is:
strrpos returns: "0"
string_1 if is true
strrpos returns: ""
string_2 if is false
PHP was configured using ./configure --with-pgsql=/usr/local/pgsql --with-apache=../apache_1.3.12 --enable-track-vars
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 14 19:00:01 2026 UTC |
This script works properly on PHP4: $string_1="<test>"; $string_2="test"; print("strrpos returns: \"".strrpos($string_1,"<")."\"<br>"); if(strrpos($string_1,"<")===0) print "string_1 if is true<br>"; else print "string_1 if is false<br>"; print("strrpos returns: \"".strrpos($string_2,"<")."\"<br>"); if(strrpos($string_2,"<")===0) print "string_2 if is true<br>"; else print "string_2 if is false<br>";