[PHP-DEV] PHP 4.0 Bug #8061 Updated: wordwrap From: fmk <email protected>
Date: 11/30/00

ID: 8061
Updated by: fmk
Reported By: al.wo <email protected>
Status: Closed
Bug Type: Strings related
Assigned To:
Comments:

Counter used to find split position was compared with the string length. A string of length 40 will have positions 0-39.
The bug has been fixed.

Previous Comments:
---------------------------------------------------------------------------

[2000-11-30 18:20:34] al.wo <email protected>
The function wordwrap seems to have a bug:

$tmp1="xxxxxxxx! dsfksdjfklsdjf sdflkjxxxx 1111";
$tmp2 = wordwrap($tmp1, 39);

this gives the *wrong* result - this string is 40 chars long!:
--- Cut ---
xxxxxxxx! dsfksdjfklsdjf sdflkjxxxx 1111
--- Cut ---

if you use
$tmp1="xxxxxxxx! dsfksdjfklsdjf sdflkjxxxx 1111x";
$tmp2 = wordwrap($tmp1, 39);

this gives the *correct* result:
--- Cut ---
xxxxxxxx! dsfksdjfklsdjf sdflkjxxxx
1111x
--- Cut ---

---------------------------------------------------------------------------

Full Bug description available at: http://bugs.php.net/?id=8061

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>