How is it going with the implementation of these changes? There are couple
of bug reports that would probably be resolved with your patch (#12768
#13362)


> Ok, since I didn't get much feedback (with the exception of Derick) I
> think this is how I am going to proceed with the wordwrap problems:
>
> width = 0 : Error out with appropriate message
> width > 0 : Cut lines at "width" characters. (Not including the
> break characters.)
>
> So:
> -----------------------------------------------------------
> <?php
> wordwrap("this is my string", 1, "...\n", 1);
> ?>
> -----------------------------------------------------------
>
> Will result in:
> t...
> h...
> i...
> s...
>  ...
> i...
> s...
>  ...
> m...
> y...
>  ...
> s...
> t...
> r...
> i...
> n...
> g...
>
> If no one responds, I will assume its satisfactory.
>
> Thanks,
> Sean
>
> > -----Original Message-----
> > From: Sean R. Bright [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, October 10, 2001 6:24 AM
> > To: 'Derick Rethans'
> > Cc: 'PHP Developers Mailing List'
> > Subject: RE: [PHP-DEV] wordwrap confusion.
> >
> >
> > I don't think you understand what I mean.
> >
> > In my patch, if a width is specified that is 0 or less than 0, a
> > warning is printed and the width is defaulted to 75.  You are right
> > when you say that the default is already 75, but that is when width
> > is not even specified.  Also, 1 makes as much sense to me as 2 does
> > or greater does when "cut" is set to true.
> >
> > Sean
> > ---------------------------------------------------------------------
> > > -----Original Message-----
> > > From: Derick Rethans [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, October 10, 2001 2:27 AM
> > > To: Sean R. Bright
> > > Cc: PHP Developers Mailing List
> > > Subject: Re: [PHP-DEV] wordwrap confusion.
> > >
> > >
> > > 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 - [EMAIL PROTECTED]
> > >              SRM: Site Resource Manager - www.vl-srm.net
> > >
> > ---------------------------------------------------------------------
> > >
> > >
> > > --
> > > PHP Development Mailing List <http://www.php.net/>
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to