|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-09-22 20:17 UTC] rm at drgs dot no
[2007-10-07 13:57 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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 )