On Tue, Feb 17, 2015 at 7:02 AM, Dennis Birkholz <den...@birkholz.biz> wrote:
> Am 17.02.2015 um 12:30 schrieb Leigh:
>> And you find taking authority over a library away from the library
>> author completely acceptable?
>>
>> If I write an API that works perfectly well in strict mode, why
>> shouldn't I be able to turn strict on for my whole library? Do I just
>> tell users that non-strict mode constitutes undefined behavior for
>> this library, and refuse to fix any bugs that come up because of it?
>
> As the library author you will never ever notice if your library was
> called in strict mode or not! And that is the point: you will not get
> any gain from making all your parameters strict, you will just force the
> user to cast (as Rasmus said already).

No, and Rasmus examples, while being technically correct for some of
them, just add confusions to the stack. The caller, and the calls to
internals function in the caller codes, won't be affected, at all.
Please understand it. Only the library code will.

Now we can surely find other cases where we may adapt the patch or be
more obvious, but for my own sake, get over this "it will break and
change everything everywhere", it does not.


> Repeating that strict mode is required from a library author's point of
> view does not make it right. You always get the types you want, you just
> limit the library consumer.

No, you do not.

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

Reply via email to