php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69256 mb_split() cannot divide into char by char
Submitted: 2015-03-18 15:57 UTC Modified: 2016-08-20 10:49 UTC
From: ryosuke_i_628 at yahoo dot co dot jp Assigned:
Status: Open Package: mbstring related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
15 - 7 = ?
Subscribe to this entry?

 
 [2015-03-18 15:57 UTC] ryosuke_i_628 at yahoo dot co dot jp
Description:
------------
mb_split() cannot divide into char by char using the expression '(?<!\A)(?!\z)'.

Test script:
---------------
$str = "あいうえお";
mb_regex_encoding('UTF-8');
print_r([
    'PCRE' => preg_split('/(?<!\A)(?!\z)/u', $str),
    '鬼車' => mb_split('(?<!\A)(?!\z)', $str)
]);

Expected result:
----------------
Array
(
    [PCRE] => Array
        (
            [0] => あ
            [1] => い
            [2] => う
            [3] => え
            [4] => お
        )

    [鬼車] => Array
        (
            [0] => あ
            [1] => い
            [2] => う
            [3] => え
            [4] => お
        )

)
[Finished in 0.5s]

Actual result:
--------------
Array
(
    [PCRE] => Array
        (
            [0] => あ
            [1] => い
            [2] => う
            [3] => え
            [4] => お
        )

    [鬼車] => Array
        (
            [0] => あ
            [1] => いうえお
        )

)
[Finished in 0.5s]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-20 10:49 UTC] cmb@php.net
-Package: Regexps related +Package: mbstring related
 [2016-08-20 10:49 UTC] cmb@php.net
I suspect that has the same cause as bug #69433.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC