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.

In terms of KISS, 10 means 10.

Unless PHP !== KISS therefore 10 === 9.

Make the break. Deal with it. It was wrong and now it is fixed.

On 13/11/06, Antony Dovgal <[EMAIL PROTECTED]> 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 
<maxlen>
characters instead of <maxlen - 1>, as they do in 5.2 (and I'm pretty sure this 
is the way
they used to work since their very first appearance in PHP).
So, anybody relying on fgets($fp, 10) to return 9 characters would get 10 
characters instead.

Yes, this behaviour is not very intuitive for those who are not familiar with 
fgets() in C,
but it's well documented and pretty much expected.

I believe this is an unreasonable BC break and I strongly believe it should be 
fixed.
There are 0 reasons to do it (without any discussion) and it can only result in 
more users' confusion,
even if the original purpose was the contrary.

--
Wbr,
Antony Dovgal

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php




--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to