php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60344 Wrong reference to mb_regex_encoding()
Submitted: 2011-11-21 02:24 UTC Modified: 2011-12-21 15:16 UTC
From: M8R-kilsyf at mailinator dot com Assigned: bjori (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: M8R-kilsyf at mailinator dot com
New email:
PHP Version: OS:

 

 [2011-11-21 02:24 UTC] M8R-kilsyf at mailinator dot com
Description:
------------
==========================================

I believe there are two wrong references to mb_regex_encoding() on the following two pages:

http://www.php.net/function.mb-internal-encoding#refsect1-function.mb-internal-encoding-notes

http://www.php.net/function.mb-strrpos#refsect1-function.mb-strrpos-notes

These pages aren't related to regular expressions - and the source code and a test indicates that their internal character encoding is given by the encoding of mb_internal_encoding(), instead of mb_regex_encoding().

Thank you very much for your help! :)

==========================================

<?

mb_internal_encoding("UTF-16");
echo mb_strrpos("\x00\x74\x00\x65\x00\x73\x00\x74","\x00\x73"); // 2

mb_internal_encoding("UTF-8");
echo mb_strrpos("\x00\x74\x00\x65\x00\x73\x00\x74","\x00\x73"); // 4

mb_regex_encoding("UTF-16"); // does not seem to change anything
echo mb_strrpos("\x00\x74\x00\x65\x00\x73\x00\x74","\x00\x73"); // 4

mb_regex_encoding("UTF-8"); // does not seem to change anything
echo mb_strrpos("\x00\x74\x00\x65\x00\x73\x00\x74","\x00\x73"); // 4

?>

==========================================


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-21 15:16 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=321296
Log: Remove irrelevant note mentioning regex charset, fixes bug#60344
 [2011-12-21 15:16 UTC] bjori@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Nice catch
 [2011-12-21 15:16 UTC] bjori@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bjori
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 05:00:01 2026 UTC