Re: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Manuel Lemos

Hello,

Mark Charette wrote:
> 
> > -Original Message-
> > From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> > Before somebody decides to repress my opinion again,
> 
> Hah! That's got to be one of the funniest things I've ever read!
> 
> Downloads do not imply usage, only curiosity. I've downloaded a large number
> of PHP class libraries from different places. The only one I've ever used is
> a CC validation one ...

Duh? What does what you said have to do with what you quoted from my
message? :-)

Regards,
Manuel Lemos

-- 
PHP General 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]




Re: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Philip Olson

BC was broken, this happens sometimes.  The majority of the PHP Dev team
agrees that strtok() should be POSIX compliant, so it is now, and forever
will be.

Not being in NEWS/Changelog was an oversight/error, nobody is perfect.
This not happening in the future is a desire of everyone.  Also, it'll be
nice when every BC break is clearly documented in one place, deprecations
too. Your desires on the matter are shared by all, in that, allowing for
seamless PHP upgrades is a good thing.

Such breaks are very uncommon in the PHP world, you will find that some
members want many more :))  

This is documented now which is as best we can do at this point.  That and
clearly document all BC breaks in the future.  I vow to help on the
documentation end.

Regards,
Philip Olson


On Mon, 14 Jan 2002, Manuel Lemos wrote:

> Hello,
> 
> I don't disagree, but the fact is that doesn't help anybody that used
> the function and relied on its original behaviour that was there for 4
> years.
> 
> As for being POSIX compliant, I don't think that POSIX states anything
> about how PHP functions should behave, so I do not see where is the gain
> of breaking this function, especially when making PHP strtok behave
> exactly like C strtok is absolutely irrelevant I think for 99,9% of PHP
> users because they don't use C in POSIX at all. As a side note, based on
> the Web browser share distribution of the PHP Classes site, I think the
> majority of PHP users come from Windows now, but I may be wrong.
> 
> Anyway, if breaking the behaviour of a long standing function was bad,
> what really made it worse the was fact that who has broken the function,
> did not even have the decency to note down in the NEWS/ChangeLog, so
> whoever plans to upgrade to PHP 4.1.0 could be warned and avoided
> outages due to this silent backwards incompatible change.
> 
> Documenting the new behaviour in the user manual does not help even if
> it was not made much later after releasing PHP 4.1.0 like this change
> that was only documented because there was a bug report much later after
> the change was done. What happens is that careful developers tend to
> take a look in the ChangeLog before installing a new version in a
> production environment to avoid outages and misbehaviour cause by the
> change in the broken function. Since it did not happen even until today,
> nobody is being warned and depending on what the function is used for,
> it may be causing data trashing of site databases until the developers
> realize what happened.
> 
> Don't you have a requirement in the PHP CODING STANDARDS file that makes
> it mandatory for PHP developers to note down important changes? Not
> having such requirement just allows messy development habits to
> jeopardize PHP code quality.
> 
> Before somebody decides to repress my opinion again, notice how I am
> trying to be constructive by suggesting improvements in the quality of
> PHP development process. Now you may put that gun down. :-)
> 
> Regards,
> Manuel Lemos



-- 
PHP General 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]




RE: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Mark Charette

> -Original Message-
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Before somebody decides to repress my opinion again,

Hah! That's got to be one of the funniest things I've ever read!

Downloads do not imply usage, only curiosity. I've downloaded a large number
of PHP class libraries from different places. The only one I've ever used is
a CC validation one ...

mark C.



-- 
PHP General 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]




Re: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Manuel Lemos

Hello,

Rasmus Lerdorf wrote:
> 
> You call it broken, we call it finally making them POSIX-compliant.
> Whatever floats your boat.

I don't disagree, but the fact is that doesn't help anybody that used
the function and relied on its original behaviour that was there for 4
years.

As for being POSIX compliant, I don't think that POSIX states anything
about how PHP functions should behave, so I do not see where is the gain
of breaking this function, especially when making PHP strtok behave
exactly like C strtok is absolutely irrelevant I think for 99,9% of PHP
users because they don't use C in POSIX at all. As a side note, based on
the Web browser share distribution of the PHP Classes site, I think the
majority of PHP users come from Windows now, but I may be wrong.

Anyway, if breaking the behaviour of a long standing function was bad,
what really made it worse the was fact that who has broken the function,
did not even have the decency to note down in the NEWS/ChangeLog, so
whoever plans to upgrade to PHP 4.1.0 could be warned and avoided
outages due to this silent backwards incompatible change.

Documenting the new behaviour in the user manual does not help even if
it was not made much later after releasing PHP 4.1.0 like this change
that was only documented because there was a bug report much later after
the change was done. What happens is that careful developers tend to
take a look in the ChangeLog before installing a new version in a
production environment to avoid outages and misbehaviour cause by the
change in the broken function. Since it did not happen even until today,
nobody is being warned and depending on what the function is used for,
it may be causing data trashing of site databases until the developers
realize what happened.

Don't you have a requirement in the PHP CODING STANDARDS file that makes
it mandatory for PHP developers to note down important changes? Not
having such requirement just allows messy development habits to
jeopardize PHP code quality.

Before somebody decides to repress my opinion again, notice how I am
trying to be constructive by suggesting improvements in the quality of
PHP development process. Now you may put that gun down. :-)

Regards,
Manuel Lemos

> 
> -Rasmus
> 
> On Mon, 14 Jan 2002, Manuel Lemos wrote:
> 
> > Hello,
> >
> > Alain Samoun wrote:
> > >
> > > Manuel:
> > > What is broken with strtok() since php4.06? So far my code that use it seems
> > > to work ok with PHP4.10...??? I'd Like to know ;)
> >
> > If the token character is the first of the string you want to tokenize,
> > now strtok ignores it, before it would return an empty string. For
> > instance strtok("/something","/") would return "" but since strtok was
> > broken it returns "something". This makes strtok completely useless to
> > break an arbitrary string by tokens because it will discard the first
> > token if it is an empty string.
> >
> > The strtok function behaved like that since it was introduced in PHP 3.
> > If you figure that this change will break your PHP code, you may want to
> > try the function in the page below. It also contains a fixed version of
> > dirname that was also broke between PHP 4 and 4.1.0.
> >
> > Regards,
> > Manuel Lemos
> >
> >
> > > A+
> > > Alain
> > >
> > > -Original Message-
> > > From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> > > Sent: Sunday, January 13, 2002 2:44 PM
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Robert Mena
> > > Subject: [PHP-DEV] Re: strtok bug
> > >
> > > Hello,
> > >
> > > Robert Mena wrote:
> > > >
> > > > Hi, does anybody know when the strtok bug introduced
> > >
> > > After 4.0.6 .
> > >
> > > > in 4.1.1 will be fixed ?
> > > > Will we have a 4.1.2 or should I try to grab a cvs
> > > > tree (assuming that it is already solved) ?
> > >
> > > You may want to ask that in php-dev mailing list because last time that
> > > I reported it I was told that it would not be fixed because it was just
> > > me complaining.
> > >
> > > Actually, I don't think that who has broken strtok noticed that he
> > > broken the behaviour that was always like that since the function was
> > > introduced in PHP 3, so the change was never documented. This suggests
> > > that like you and me there are certainly much more people affected that
> > > have not realized that strtok was broken and that it will affect their
> > > code.
> > >
> > > Anyway, since PHP developers do not seem to be willing to fix what they
> > > broke, regardless if they ever reconsider, you may want to try this
> > > alternative function that behaves like the original and only relies on
> > > functions that were not (yet) broken, so you don't stop yourself from
> > > upgrading PHP.
> > >
> > > http://phpclasses.upperdesign.com/browse.html/package/404
> > >
> > > I also had several popular classes of mine broken because of the strtok
> > > bug. Since they are very popular the changes were announce in Freshmeat
> > > which according to the PHP Classes site they were download

Re: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Rasmus Lerdorf

You call it broken, we call it finally making them POSIX-compliant.
Whatever floats your boat.

-Rasmus

On Mon, 14 Jan 2002, Manuel Lemos wrote:

> Hello,
>
> Alain Samoun wrote:
> >
> > Manuel:
> > What is broken with strtok() since php4.06? So far my code that use it seems
> > to work ok with PHP4.10...??? I'd Like to know ;)
>
> If the token character is the first of the string you want to tokenize,
> now strtok ignores it, before it would return an empty string. For
> instance strtok("/something","/") would return "" but since strtok was
> broken it returns "something". This makes strtok completely useless to
> break an arbitrary string by tokens because it will discard the first
> token if it is an empty string.
>
> The strtok function behaved like that since it was introduced in PHP 3.
> If you figure that this change will break your PHP code, you may want to
> try the function in the page below. It also contains a fixed version of
> dirname that was also broke between PHP 4 and 4.1.0.
>
> Regards,
> Manuel Lemos
>
>
> > A+
> > Alain
> >
> > -Original Message-
> > From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, January 13, 2002 2:44 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Robert Mena
> > Subject: [PHP-DEV] Re: strtok bug
> >
> > Hello,
> >
> > Robert Mena wrote:
> > >
> > > Hi, does anybody know when the strtok bug introduced
> >
> > After 4.0.6 .
> >
> > > in 4.1.1 will be fixed ?
> > > Will we have a 4.1.2 or should I try to grab a cvs
> > > tree (assuming that it is already solved) ?
> >
> > You may want to ask that in php-dev mailing list because last time that
> > I reported it I was told that it would not be fixed because it was just
> > me complaining.
> >
> > Actually, I don't think that who has broken strtok noticed that he
> > broken the behaviour that was always like that since the function was
> > introduced in PHP 3, so the change was never documented. This suggests
> > that like you and me there are certainly much more people affected that
> > have not realized that strtok was broken and that it will affect their
> > code.
> >
> > Anyway, since PHP developers do not seem to be willing to fix what they
> > broke, regardless if they ever reconsider, you may want to try this
> > alternative function that behaves like the original and only relies on
> > functions that were not (yet) broken, so you don't stop yourself from
> > upgrading PHP.
> >
> > http://phpclasses.upperdesign.com/browse.html/package/404
> >
> > I also had several popular classes of mine broken because of the strtok
> > bug. Since they are very popular the changes were announce in Freshmeat
> > which according to the PHP Classes site they were downloaded by more
> > than 30.000 users, despite on of the justifications for not fixing the
> > bug was that it was not affecting significant code bases, which is not
> > true as you may notice.
> >
> > Email validation class
> > http://freshmeat.net/releases/66935/
> >
> > HTTP client class
> > http://freshmeat.net/releases/66937/
> >
> > POP3 client class
> > http://freshmeat.net/releases/66938/
> >
> > MIME message composing and sending class
> > http://freshmeat.net/releases/66936/
> >
> > SMTP client class
> > http://freshmeat.net/releases/66940/
> >
> > Regards,
> > Manuel Lemos
> >
> > --
> > PHP Development Mailing List 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General 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 General 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]