Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-16 Thread Antony Dovgal
The issue is now solved, thank you. EOD On 11/14/2006 12:38 AM, Antony Dovgal wrote: Hello all. I'd like to continue recent IRC discussion here, to draw more attention to this issue. At the moment functions fgets() and fgetss() are broken in HEAD, as they return characters instead of , as

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-16 Thread Zeev Suraski
At 06:48 16/11/2006, Sara Golemon wrote: Zeev- My IQ is higher than 12, and I don't see how defensive coding could have defended against this BC break. This code is missing error checking, but that could be quite reasonable (e.g. if you check ahead of time that the file is big enough to matc

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-15 Thread Sara Golemon
Zeev- My IQ is higher than 12, and I don't see how defensive coding could have defended against this BC break. This code is missing error checking, but that could be quite reasonable (e.g. if you check ahead of time that the file is big enough to match the format you're expecting - so it's n

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-15 Thread Stanislav Malyshev
Sorry, I meant to say "Noone with an IQ higher than twelve is relying on this." PHP Developer 1: Let's change functionality for some widely-used function and break BC, because we can and it is so much fun! PHP Developer 2: You know, breaking BC is not nice, people really rely on it and try to

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-15 Thread Zeev Suraski
At 13:04 15/11/2006, Sara Golemon wrote: [EMAIL PROTECTED] wrote: On Tue, November 14, 2006 2:59 pm, Sara Golemon wrote: keeping. I'll lay money that NOONE is relying on this, and I challenge any of you to prove me wrong on that count. E. You may want to re-think that bet... Surely somebo

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-15 Thread Sara Golemon
[EMAIL PROTECTED] wrote: On Tue, November 14, 2006 2:59 pm, Sara Golemon wrote: keeping. I'll lay money that NOONE is relying on this, and I challenge any of you to prove me wrong on that count. E. You may want to re-think that bet... Surely somebody out there has: Sorry, I meant to s

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-15 Thread Richard Lynch
On Tue, November 14, 2006 2:59 pm, Sara Golemon wrote: > keeping. I'll lay money that NOONE is relying on this, and I > challenge > any of you to prove me wrong on that count. E. You may want to re-think that bet... Surely somebody out there has: even if you and I both know how horrible t

[PHP-DEV] [SPAM] Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Steph Fox
It better be in Canadian dollars ;) (Yeah I got inet access again) Sara, more seriously, when Zeev puts in a plea and Edin's saying the same thing, it's likely you're misjudging the situation. It's a rare event :) On 14-Nov-06, at 3:59 PM, Sara Golemon wrote: I'll lay money that NOONE is re

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Ilia Alshanetsky
On 14-Nov-06, at 3:59 PM, Sara Golemon wrote: I'll lay money that NOONE is relying on this, and I challenge any of you to prove me wrong on that count. Just how much money are we talking about here? ;-) http://www.google.com/codesearch?as_q=fgets%5C%28%5C%24%5BA-Za-z0-9_% 5D%2B%2C+2%5C%29%3

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Stanislav Malyshev
As I told tony in IRC, I don't care if the behavior gets changed back to 5.2 style, although I don't think this is a BC we need to worry about keeping. I'll lay money that NOONE is relying on this, and I challenge any of you to prove me wrong on that count. How much money? ;) Anyway, if nobod

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Wez Furlong
I'd lay money on someone somewhere having something critical relying on the traditional behavior. IIRC, this came up before and we decided to preserve the way it worked. I don't see any need to change this in 6 or any later version. As crappy as that may be, BC is BC. :-/ --Wez. On 11/14/06, S

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Zeev Suraski
I can't prove you wrong, but to me it sounds extremely reasonable that there'd be a lot of lines of code that rely on that behavior exactly. You believe nobody is using fgets() to read, say, 3 bytes? Unless I'm missing something, whenever someone uses this function to read an exact number of

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Zeev Suraski
Richard, Really, this has been discussed so many times. Backwards compatibility breakage accumulates. It's not a binary. "If we break something we can break everything since it's broken anyway" is not very convincing. The more you break the worse things are, the more work you have to do in

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Sara Golemon
Antony Dovgal wrote: On 11/14/2006 08:26 AM, Andi Gutmans wrote: Sounds like something which indeed isn't worth breaking. Was this intentional? Sara says it was intentional, that's why I decided to write to the list. I don't think such intentional breaks should take place in any PHP version.

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Pierre
Hello, On 11/14/06, Antony Dovgal <[EMAIL PROTECTED]> wrote: On 11/14/2006 08:56 PM, Pierre wrote: > Hello, > > On 11/14/06, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: >> > The comparison Tony made was between <=5.X and PHP 6, I do not believe >> > anyone is suggesting to modify the 5.2.x beh

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Antony Dovgal
On 11/14/2006 08:56 PM, Pierre wrote: Hello, On 11/14/06, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > The comparison Tony made was between <=5.X and PHP 6, I do not believe > anyone is suggesting to modify the 5.2.x behavior. Yes, I noticed later it's PHP 6, but it does not change a thing

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Pierre
Hello, On 11/14/06, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > The comparison Tony made was between <=5.X and PHP 6, I do not believe > anyone is suggesting to modify the 5.2.x behavior. Yes, I noticed later it's PHP 6, but it does not change a thing - it's still totally unnecessary BC bre

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Stanislav Malyshev
The comparison Tony made was between <=5.X and PHP 6, I do not believe anyone is suggesting to modify the 5.2.x behavior. Yes, I noticed later it's PHP 6, but it does not change a thing - it's still totally unnecessary BC break for the sake of meaningless purism. It adds nothing to the languag

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Richard Quadling
On 14/11/06, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: On 14-Nov-06, at 3:34 AM, Stanislav Malyshev wrote: >> It seems utterly ridiculous to return maxlen-1. >> Whilst this is sure as hell a BC, it should work "properly". If I ask >> for 10, I want 10. I wouldn't have asked for 10 otherwise.

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Ilia Alshanetsky
On 14-Nov-06, at 3:34 AM, Stanislav Malyshev wrote: It seems utterly ridiculous to return maxlen-1. Whilst this is sure as hell a BC, it should work "properly". If I ask for 10, I want 10. I wouldn't have asked for 10 otherwise. Having to know the "magic" to get things to work is plainly bad ma

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Christian Schneider
Richard Quadling wrote: And so why are we losing register_globals? For a LOT of code they work and removing rg is sure as hell a BC for a lot of code. And we move This was done for *good* reason. You don't gain a lot of security (or even code clearity/brevity) by changing fgets. That's the dif

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Richard Quadling
On 14/11/06, Antony Dovgal <[EMAIL PROTECTED]> wrote: "It works this way since PHP3" means "it works right" even if there was a bug in PHP3. That's because thousands of people could rely on this behaviour (which is, I repeat, very well documented and pretty much expected). And so why are we l

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Edin Kadribasic
Antony Dovgal wrote: > On 11/14/2006 08:26 AM, Andi Gutmans wrote: >> Sounds like something which indeed isn't worth breaking. Was this >> intentional? > > Sara says it was intentional, that's why I decided to write to the list. > I don't think such intentional breaks should take place in any PHP

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Antony Dovgal
On 11/14/2006 11:24 AM, Richard Quadling wrote: As we are often told on this list, PHP is not C. It seems utterly ridiculous to return maxlen-1. It also might seem ridiculous to have strlen() and str_replace(), but there are good reasons to have strlen() instead of str_len(). Whilst this is

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Antony Dovgal
-Original Message- From: Antony Dovgal [mailto:[EMAIL PROTECTED] Sent: Monday, November 13, 2006 1:39 PM To: php-dev Subject: [PHP-DEV] fgets()/fgetss() BC break in HEAD Hello all. I'd like to continue recent IRC discussion here, to draw more attention to this issue. At the moment f

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Stanislav Malyshev
Richard Quadling wrote: Just because it has always done it doesn't mean it always will. That's what BC's are about. BC, as far as I know, is "backwards compatibility". It is *exactly* about "it has always done so and it always will". And unless there's a *very* good reason not to do it, so it

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Richard Quadling
Just because it has always done it doesn't mean it always will. That's what BC's are about. If this was to be a BC, having it mid version is not a good idea. Maybe for V6 where a whole LOAD of things are going to change, making it another part of the clean up process would be a better option. On

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Stanislav Malyshev
It always returned length-1, manual says length-1, so suddenly in version 5.2.1 it starts returning length instead. And now imagine Didn't notice - it is about HEAD not 5.2. It's less critical then but still as bad. People moving to PHP 6 would have enough things to worry without changing f

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Stanislav Malyshev
It seems utterly ridiculous to return maxlen-1. Whilst this is sure as hell a BC, it should work "properly". If I ask for 10, I want 10. I wouldn't have asked for 10 otherwise. Having to know the "magic" to get things to work is plainly bad magic. It always returned length-1, manual says length

Re: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-14 Thread Richard Quadling
As we are often told on this list, PHP is not C. It seems utterly ridiculous to return maxlen-1. Whilst this is sure as hell a BC, it should work "properly". If I ask for 10, I want 10. I wouldn't have asked for 10 otherwise. Having to know the "magic" to get things to work is plainly bad magic.

RE: [PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-13 Thread Andi Gutmans
Sounds like something which indeed isn't worth breaking. Was this intentional? > -Original Message- > From: Antony Dovgal [mailto:[EMAIL PROTECTED] > Sent: Monday, November 13, 2006 1:39 PM > To: php-dev > Subject: [PHP-DEV] fgets()/fgetss() BC break in HEAD >

[PHP-DEV] fgets()/fgetss() BC break in HEAD

2006-11-13 Thread Antony Dovgal
Hello all. I'd like to continue recent IRC discussion here, to draw more attention to this issue. At the moment functions fgets() and fgetss() are broken in HEAD, as they return characters instead of , as they do in 5.2 (and I'm pretty sure this is the way they used to work since their very