go to bug id or search bugs for
If the input string contains multibyte characters and the length argument is greater then the possible maximum length of the result the function returns false.
grapheme_substr('FOK', 1, 20), // expected: OK
grapheme_substr('한국어', 1, 20) //expected: 국어
Add a Patch
Add a Pull Request
I can confirm this bug, but I'm not sure how to fix it correctly. If I fix the
related logic, the substr tests then partially fail. This function is cryptic and
should really deserve some comments about what means each variable name and what
are their goals...
Automatic comment from SVN on behalf of stas
Log: fix bug 55562 - make substr always return rest of the string if length is too long
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.