]> granicus.if.org Git - php/commitdiff
test for 42866
authorStanislav Malyshev <stas@php.net>
Wed, 21 Nov 2007 02:24:47 +0000 (02:24 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 21 Nov 2007 02:24:47 +0000 (02:24 +0000)
ext/standard/tests/strings/bug42866.phpt [new file with mode: 0755]

diff --git a/ext/standard/tests/strings/bug42866.phpt b/ext/standard/tests/strings/bug42866.phpt
new file mode 100755 (executable)
index 0000000..bfd8e31
--- /dev/null
@@ -0,0 +1,30 @@
+--TEST--
+Bug #42866 str_split() returns extra char when given string size is not mulitple of lenth
+--FILE--
+<?php
+$str = 'Testing str_split()';
+$split_length = 5;
+var_dump( str_split($str, $split_length) );
+?>
+--EXPECT--
+array(4) {
+  [0]=>
+  string(5) "Testi"
+  [1]=>
+  string(5) "ng st"
+  [2]=>
+  string(5) "r_spl"
+  [3]=>
+  string(4) "it()"
+}
+--UEXPECT--
+array(4) {
+  [0]=>
+  unicode(5) "Testi"
+  [1]=>
+  unicode(5) "ng st"
+  [2]=>
+  unicode(5) "r_spl"
+  [3]=>
+  unicode(4) "it()"
+}
\ No newline at end of file