[PATCH] Bug #42866 str_split() returns extra char when given string size is not multiple of length

php.internals

Claudio Cherubino

18 years ago
Bug Description: ----------------- str_split() returns extra characters when given string is not multiple of given length. For example if the given string size is 22 and split length is 5, then the last element of the returned array contains 5 or more than 5 chars, which is wrong. The last element of the return array should only contain 2 chars. The bug only occurs on PHP6 with UNICODE ON. It can be fixed by changing only a single line of the code. Please give a look at the attached patch, I don't have CVS access to commit it. Thanks Claudio Cherubino