php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42206 Bug from function strrpos
Submitted: 2007-08-04 09:55 UTC Modified: 2007-08-04 12:18 UTC
From: haict at runsystem dot net Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.4.7 OS: Widows Server 2003
Private report: No CVE-ID: None
 [2007-08-04 09:55 UTC] haict at runsystem dot net
Description:
------------
I got a false result when i run bellow script:


I tested that script on Windows Server 2003 and Redhad Enterprice Linux 4 with versions: 4.3.11, 4.4.2 and 4.4.7

Reproduce code:
---------------
<?php
	$str = "ABCON_TS_UPDATE_TIMESTAMP";
	$order_pos = strrpos($str, "ORDER");
	echo $order_pos ;
?>


Expected result:
----------------
if true $order_pos === false;

Actual result:
--------------
I got a string in my screen which is 3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-04 12:18 UTC] scottmac@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

In PHP 4 the needle can only be a single character so you end up searching for O which is as position 3.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 11:01:28 2024 UTC