#42591 [Opn->Bgs]: wordwrap doesn't generate warning message when width is given as -ne or 0 value
| From: | iliaa@php.net | Date: | Sun, 09 Sep 2007 16:06:26 +0000 |
| Subject: | #42591 [Opn->Bgs]: wordwrap doesn't generate warning message when width is given as -ne or 0 value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117331@lists.php.net to get a copy of this message | ||
ID: 42591
Updated by: iliaa@php.net
Reported By: kraghuba at in dot ibm dot com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: linux, windows
PHP Version: 5CVS-2007-09-07 (snap)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
When the line length is <= 0 it leaves the string untouched, this is
expected behavior.
Previous Comments:
------------------------------------------------------------------------
[2007-09-08 01:52:34] crrodriguez at suse dot de
In case this is considered a bug ( IMHO it should emit such warning)
fix:
http://www.kissofjudas.net/patches/wordwrap.patch
------------------------------------------------------------------------
[2007-09-07 16:30:30] kraghuba at in dot ibm dot com
Description:
------------
wordwrap() doesn't generate warning message when width argument is
given as a negative or zero value.
this is applicable to php5 and php6.
Reproduce code:
---------------
<?php
$text = "The quick brown fox jumped over the lazy dog.";
var_dump( wordwrap($text, 0, "<br/>\n") );
var_dump( wordwrap($text, -1 , "<br />\n") );
var_dump( wordwrap($text, 0) );
var_dump( wordwrap($text, -1) );
?>
Expected result:
----------------
warning messages should be generated
Actual result:
--------------
string(85) "The<br/>
quick<br/>
brown<br/>
fox<br/>
jumped<br/>
over<br/>
the<br/>
lazy<br/>
dog."
string(93) "The<br />
quick<br />
brown<br />
fox<br />
jumped<br />
over<br />
the<br />
lazy<br />
dog."
string(45) "The
quick
brown
fox
jumped
over
the
lazy
dog."
string(45) "The
quick
brown
fox
jumped
over
the
lazy
dog."
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42591&edit=1