On 2016-10-13 22:39, Yasuo Ohgaki wrote:
Hi Stas, Niklas,

On Thu, Oct 13, 2016 at 2:13 PM, Stanislav Malyshev <smalys...@gmail.com> wrote:
Sorry for the late reply. Why not keep the current behavior + warning?

Because current behavior makes no sense, negative length is not really
something that exists.

I agree Stas.

If we consider compatibility, keeping nonsense behavior is better.
However, who sets negative offset and make use of it?
Compatibility is important, but this current behavior is not important, IMO.

Keeping the current behavior doesn't really cost anything.
Why change it?

It's very easy to imagine a script like this:

$text_width = $parent_width - $other_width - $margin;
echo wordwrap($text, $text_width);

Here someone tries to calculate $max_width dynamically.
The calculation might produce a negative result sometimes.
The text would be visible, even if it's not word wrapped.
It might not look as expected, but it would be readable.

Lauri Kenttä

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

Reply via email to