mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
30 lines
484 B
Plaintext
30 lines
484 B
Plaintext
|
--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()"
|
||
|
}
|