#42591 [NEW]: wordwrap doesn't generate warning message when width is given as -ne or 0 value
| From: | kraghuba at in dot ibm dot com | Date: | Fri, 07 Sep 2007 16:30:30 +0000 |
| Subject: | #42591 [NEW]: wordwrap doesn't generate warning message when width is given as -ne or 0 value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-117295@lists.php.net to get a copy of this message | ||
From: kraghuba at in dot ibm dot com
Operating system: linux, windows
PHP version: 5CVS-2007-09-07 (snap)
PHP Bug Type: Strings related
Bug description: wordwrap doesn't generate warning message when width is given as -ne or 0
value
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 bug report at http://bugs.php.net/?id=42591&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42591&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42591&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42591&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42591&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42591&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42591&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42591&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42591&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42591&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42591&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42591&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42591&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42591&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42591&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42591&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42591&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42591&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42591&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42591&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42591&r=mysqlcfg