Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mb_split() can now handle empty matches like preg_split() does.
- Loading branch information
Showing
4 changed files
with
49 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
mb_split() empty match | ||
-- | ||
--SKIPIF-- | ||
<?php | ||
extension_loaded('mbstring') or die('skip'); | ||
function_exists('mb_split') or die("skip mb_split() is not available in this build"); | ||
?> | ||
--FILE-- | ||
<?php | ||
mb_regex_set_options('m'); | ||
var_dump(mb_split('^', "a\nb\nc")); | ||
--EXPECT-- | ||
array(3) { | ||
[0]=> | ||
string(2) "a | ||
" | ||
[1]=> | ||
string(2) "b | ||
" | ||
[2]=> | ||
string(1) "c" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters