On Mon, Apr 24, 2017 at 1:24 PM, Fleshgrinder <p...@fleshgrinder.com> wrote:
> On 4/24/2017 10:20 PM, Stanislav Malyshev wrote:
>> Hi!
>>
>>> Because each option expects the value to be a specific type, it makes sense
>>> to enforce these types in strict type checking mode.  I'd therefore like to
>>> propose that we introduce strict type enforcement inside curl_setopt() when
>>> "declare(strict_types=1);" is being used.
>>
>> While it may make sense to check types per-option, that's not exactly
>> what scalar types are supposed to do - this is not argument typing, this
>> is internal function business logic, and I am not sure confusing the two
>> is really that good an idea.
>>
>
> I completely agree with Stanislav at this point. `curl_setopt` can and
> probably should validate the types of the various options, it may even
> throw a `TypeError`, but it most certainly should not depend on the
> `strict_types` declaration.
>
I disagree. From the user's perspective it is argument typing.  The
internal implementation detail of that argument type being dependent
on another arg's value is just a detail.

-Sara

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

Reply via email to