From: rm at drgs dot no
Operating system: Mac OS X 10.3.9
PHP version: 5.2.4
PHP Bug Type: Unicode Engine related
Bug description: Notice: preg_split(): Unknown error
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 bug report at http://bugs.php.net/?id=42737&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42737&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42737&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42737&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42737&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42737&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42737&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42737&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42737&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42737&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42737&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42737&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42737&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42737&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42737&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42737&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42737&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42737&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42737&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42737&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42737&r=mysqlcfg