]> granicus.if.org Git - php/commitdiff
add test for bug #42737.
authorNuno Lopes <nlopess@php.net>
Sun, 7 Oct 2007 14:00:20 +0000 (14:00 +0000)
committerNuno Lopes <nlopess@php.net>
Sun, 7 Oct 2007 14:00:20 +0000 (14:00 +0000)
HEAD didnt have this bug, as it uses a smarter way to iterate over utf-8 chars

ext/pcre/tests/bug42737.phpt [new file with mode: 0644]

diff --git a/ext/pcre/tests/bug42737.phpt b/ext/pcre/tests/bug42737.phpt
new file mode 100644 (file)
index 0000000..8d9dd52
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines)
+--FILE--
+<?php
+
+$string = chr(13).chr(10);
+
+$array = preg_split('//u', $string, - 1, PREG_SPLIT_NO_EMPTY);
+
+var_dump(array_map('ord', $array));
+
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  int(13)
+  [1]=>
+  int(10)
+}