Re: [RFC] Enable strict_types checking for curl_setopt()
| From: | Markus Fischer | Date: | Fri, 28 Apr 2017 14:34:46 +0000 |
| Subject: | Re: [RFC] Enable strict_types checking for curl_setopt() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98898@lists.php.net to get a copy of this message | ||
Hi,
On 22.04.17 13:40, Colin O'Dell wrote:
Hello internals, I'd like to propose an enhancement to curl_setopt() <http://php.net/manual/en/function.curl-setopt.php> which is used to configure a given curl session. The second argument of this function defines which option to set and the third argument provides the corresponding value to use. 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.I'm sorry to say but I think this /approach/ is a horrible idea :( To me the intention of strict types is clearly on the functions publicly visible contract, i.e. it's reflectable parameters and not some business logic hidden inside a function. regards, - Markus