Hi,

On Tue, Feb 17, 2015 at 5:02 PM, 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).
>
> 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.
>
> But you may want your code call other functions in strict mode to catch
> some type errors, that is perfectly valid, I don't deny that.
>

What you've said has been repeat tens of times already. Many of us
just disagree with that rationale, because it's missing the point.

Nobody is stupid enough not to know that they always receive the
specified type. There's just a big difference between knowing that you
will receive a i.e. boolean, and knowing that the user *passed* a
boolean.

Cheers,
Andrey.

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

Reply via email to