Re: wordwrap confusion.

From: Date: Wed, 10 Oct 2001 06:26:45 +0000
Subject: Re: wordwrap confusion.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67658@lists.php.net to get a copy of this message
On Tue, 9 Oct 2001, Sean R. Bright wrote: > Ok. From the documentation for wordwrap(): > > Returns a string with str wrapped at the column number > specified by the (optional) width parameter. The line > is broken using the (optional) break parameter. > > The confusion lies with the phrase "column number" and the fact > that width values of <= 0 are allowed. This is what I have > noticed from a testing perspective: > > In all tests cut = 1 > width == 0 : crash > width == 1 : results in 2-character lines > width == 2 : results in 2-character lines > width > 2 : results in width-character lines > > I have a fix in hand for the case where width == 1, but I wanted > to get a concensus among the interested parties. I plan to display > a warning for width values <= 0 and default to 75 as 0 doesn't make > much sense. It does already do that, default to 75. And does it make any sense to have width be able to be 1? I don't think so, because it's even not possible. I'm +1 for denying widths smaller then 2, and then with an error, not a warning. Derick --------------------------------------------------------------------- PHP: Scripting the Web - www.php.net - derick@php.net SRM: Site Resource Manager - www.vl-srm.net ---------------------------------------------------------------------

« previous php.dev (#67658) next »