Re: [RFC] Enable strict_types checking for curl_setopt()

From: Date: Sat, 22 Apr 2017 18:10:50 +0000
Subject: Re: [RFC] Enable strict_types checking for curl_setopt()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-98848@lists.php.net to get a copy of this message
On Sat, Apr 22, 2017 at 4:40 AM, Colin O'Dell <colinodell@gmail.com> wrote: > 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. > > The full details of the proposal, including the proposed patch, can be > found here: https://wiki.php.net/rfc/curl_setopt_strict_types > A note on the current state of the PR: Colin's RFC is based on the first commit in that PR, but after more thought and some feedback from NikiC, I piled a refactor on top of it which quite notably changes the weak-mode handling. See https://github.com/php/php-src/pull/2495#issuecomment-296383366 So some decisions to make yet regarding precisely *how* we'd land the final commit, but I hope we can all agree the intent stated in the RFC is pretty sound: Improve type checking in curl_setopt() without screwing over the majority of existing users. -Sara

« previous php.internals (#98848) next »