[PHP] Re: strtok bug

2002-01-14 Thread Manuel Lemos

Hello,

Robert Mena wrote:
> 
> Hi Manuel and all developers.
> 
> I understand that the implementation of strtok was
> "broken" (non POSIX compliant) but since it has been
> like this for ages would be better to give a chance to
> developers worldwide (that has been using and relied
> on this broken implementation) to control the
> behaviour of such feature much the same way
> REGISTER_GLOBALS (or something) in recently 4.1.0.
> 
> Imagine recoding 100+ distributed scripts to change
> this!
> 
> The decision of having this "fixed" is great but not
> paying attention (like you always did in the past)
> with backwards compatibility is (IMHO) a mistake.

My opinion precisely.

The problem is that PHP developers that decided to break strtok did not
seem to have thought of that so they did not ask any users if they were
relying on the original behaviour. They would not need to poll anybody.
Common sense can lead to the conclusion that if a function has a certain
behaviour for 4 years, chances are that there must be enough people
relying on it that changing the behaviour would break their code. It
seems that the person that broke strtok came to PHP much earlier than
that and did not cross his mind about existing users relying on the
original behaviour.

If making it POSIX compliance was a good idea, it would have been better
to add a function to the POSIX extension named posix_strtok and whoever
thinks that POSIX compliance was a good idea could use that and it would
not require breaking the existing strtok function. The same goes for
dirname function that was broken before PHP 4.0.3pl1 .

Anyway, do not count on PHP developers to ever reconsider and provide
any means to restore the original. Despite the change was only made 2
months ago, they are too proud and already state that they will not
admit it was a mistake. Usually they don't like somebody from outside to
tell them that there are better solutions, especially after the mistake
is already made.

So, I advise you to not expect anything from the PHP developers
regarding fixing the mistakes. To solve your problem it is either more
realistic to not upgrade to PHP 4.1 now (if ever) unless you have the
time to replace the calls to strtok and dirname with something else that
provides the original behaviour like those replacement functions that I
wrote and made available here:

http://phpclasses.UpperDesign.com/browse.html/package/404

Regards,
Manuel Lemos

> --- Manuel Lemos <[EMAIL PROTECTED]> wrote:
> > 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.
> >
> >
> 
> __
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/

-- 
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] Re: strtok bug

2002-01-14 Thread Robert Mena

Hi Manuel and all developers.

I understand that the implementation of strtok was
"broken" (non POSIX compliant) but since it has been
like this for ages would be better to give a chance to
developers worldwide (that has been using and relied
on this broken implementation) to control the
behaviour of such feature much the same way
REGISTER_GLOBALS (or something) in recently 4.1.0.

Imagine recoding 100+ distributed scripts to change
this!

The decision of having this "fixed" is great but not
paying attention (like you always did in the past)
with backwards compatibility is (IMHO) a mistake.

Best regards,
Robert


--- Manuel Lemos <[EMAIL PROTECTED]> wrote:
> 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.
> 
>

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
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] Re: strtok bug

2002-01-13 Thread Manuel Lemos

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