#27513 [Opn->Ana]: strrpos() using the offset
| From: | iliaa@php.net | Date: | Sat, 06 Mar 2004 18:13:36 +0000 |
| Subject: | #27513 [Opn->Ana]: strrpos() using the offset | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969359397@lists.php.net to get a copy of this message | ||
ID: 27513
Updated by: iliaa@php.net
Reported By: asterisk at email dot it
-Status: Open
+Status: Analyzed
-Bug Type: Strings related
+Bug Type: Documentation problem
-Operating System: windows xp
+Operating System: all
-PHP Version: 4.3.4
+PHP Version: all
New Comment:
The function strrpos() only supports the offset parameter
in PHP5.
Previous Comments:
------------------------------------------------------------------------
[2004-03-06 12:55:37] scottmacvicar at ntlworld dot com
http://www.php.net/strrpos
Quote from that page
---
Note: As of PHP 5.0.0 offset may be specified to begin searching an
arbitrary number of characters into the string. Negative values will
stop searching at an arbitrary point prior to the end of the string.
---
Your using PHP4 hence the error
------------------------------------------------------------------------
[2004-03-06 12:10:31] asterisk at email dot it
Description:
------------
when is used 3rd parameter, the offset, the function produce a warning
and don't return nothing
Reproduce code:
---------------
<?php
// 01234567890123
$string = "test test test";
echo strrpos ( $string, 'e', 5);
?>
Expected result:
----------------
1
Actual result:
--------------
Warning: Wrong parameter count for strrpos() in C:\WWW\strrpos.php on
line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27513&edit=1