ID: 42737
User updated by: rm at drgs dot no
Reported By: rm at drgs dot no
Status: Open
Bug Type: Unicode Engine related
Operating System: Mac OS X 10.3.9
PHP Version: 5.2.4
New Comment:
this seems to be the case with all strings which end with "\r\n"
btw, theres an extra obsolete parantesis at the end of the second
line in reproduce code, sorry
Previous Comments:
------------------------------------------------------------------------
[2007-09-22 20:11:09] rm at drgs dot no
Description:
------------
I'm splitting a string into characters with this:
preg_split('//u', $string, - 1, PREG_SPLIT_NO_EMPTY);
I get a notice on an uknown error which happens when I use the
unicode suffix u in the pattern and when the input string is
"\r\n":
$string = chr(13).chr(10);
but not when i drop the unicode option, ie. this works fine:
preg_split('//', $string, - 1, PREG_SPLIT_NO_EMPTY);
Reproduce code:
---------------
$string = chr(13).chr(10);
$array = preg_split('//u', $string, - 1, PREG_SPLIT_NO_EMPTY));
print_r(array_map('ord', $array));
Expected result:
----------------
Array
(
[0] => 13
[1] => 10
)
Actual result:
--------------
<br />
<b>Notice</b>: preg_split() [<a href='function.preg-
split'>function.preg-split</a>]: Unknown error in <b>/Users/
myname/Sites/script.php</b> on line <b>73</b><br />
Array
(
[0] => 13
[1] => 10
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42737&edit=1