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

From: Date: Mon, 24 Apr 2017 23:09:26 +0000
Subject: Re: [RFC] Enable strict_types checking for curl_setopt()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-98866@lists.php.net to get a copy of this message
Hi! > I disagree. From the user's perspective it is argument typing. The Not really. Argument typing is when arguments have types. curl_setopt arguments do not have known types, they have business logic inside that says if argument X is equal to this, then argument Y must be of that type. It's very different from what strict_types does. > internal implementation detail of that argument type being dependent > on another arg's value is just a detail. It's not "just a detail", it's the whole point of it. The value argument does not have a know type, it is typed only when you know the exact value of another argument (and sometimes not even then - e.g. CURLOPT_POSTFIELDS accepts both strings and arrays). We don't have "type that is defined by another type" in the type system, it's clearly business logic. Which I have no problem with, but it shouldn't be part of type system then. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#98866) next »