ID:               37846
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bugs dot php dot net at jonatan dot com
-Status:           Open
+Status:           Verified
 Bug Type:         Strings related
 Operating System: Mac OS X 10.4.6
 PHP Version:      5.1.4
 New Comment:

reproducible in dev branches (5.2 and head), on other OS/platform than
OSX as well.


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

[2006-06-19 10:55:33] bugs dot php dot net at jonatan dot com

Description:
------------
wordwrap() wraps incorrectly, wrapping too early in some 
situations. As the example below shows, PHP wraps one of the 
long lines ("Some text") at the maximum line length (9 
characters in this case) and wraps the other one at a shorter 
line length. Removing the first line from the test case 
results in different but equally buggy wrapping.

I'm using Marc Liyanage's build of PHP, version 5.1.4 on an 
Intel Mac.

Reproduce code:
---------------
<?php
$input =
    'Some tex '.
    'Some tex '.
    'Some text '.
    'Some tex '.
    'Some text '.
    'Some tex';
echo '<pre>'.wordwrap( $input, 9 )."</pre>\n";
?>

Expected result:
----------------
Some tex
Some tex
Some text
Some tex
Some text
Some tex


Actual result:
--------------
Some tex
Some tex
Some text
Some tex
Some
text
Some tex



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


-- 
Edit this bug report at http://bugs.php.net/?id=37846&edit=1

Reply via email to