Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98864 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81535 invoked from network); 24 Apr 2017 20:24:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2017 20:24:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.83 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.83 mx102.easyname.com Received: from [77.244.243.83] ([77.244.243.83:33722] helo=mx102.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/74-36901-90F5EF85 for ; Mon, 24 Apr 2017 16:24:42 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1d2kXG-0006xl-Rd; Mon, 24 Apr 2017 20:24:38 +0000 Reply-To: internals@lists.php.net References: To: Stanislav Malyshev , Colin O'Dell , PHP Internals Message-ID: <82da5975-aaca-580c-50ae-0b034d14b124@fleshgrinder.com> Date: Mon, 24 Apr 2017 22:24:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="10obl4QENaiqB4FEUMRtmhCIrS1e0VchH" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [RFC] Enable strict_types checking for curl_setopt() From: php@fleshgrinder.com (Fleshgrinder) --10obl4QENaiqB4FEUMRtmhCIrS1e0VchH Content-Type: multipart/mixed; boundary="mc0W2rsFAXJf9co0SqKEChCsdsAg7meg2"; protected-headers="v1" From: Fleshgrinder Reply-To: internals@lists.php.net To: Stanislav Malyshev , Colin O'Dell , PHP Internals Message-ID: <82da5975-aaca-580c-50ae-0b034d14b124@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC] Enable strict_types checking for curl_setopt() References: In-Reply-To: --mc0W2rsFAXJf9co0SqKEChCsdsAg7meg2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 4/24/2017 10:20 PM, Stanislav Malyshev wrote: > Hi! >=20 >> 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 li= ke to >> propose that we introduce strict type enforcement inside curl_setopt()= when >> "declare(strict_types=3D1);" is being used. >=20 > 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, thi= s > is internal function business logic, and I am not sure confusing the tw= o > is really that good an idea. >=20 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. --=20 Richard "Fleshgrinder" Fussenegger --mc0W2rsFAXJf9co0SqKEChCsdsAg7meg2-- --10obl4QENaiqB4FEUMRtmhCIrS1e0VchH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJY/l79AAoJEOKkKcqFPVVrHLkQALUoC9c6VTccSSg40hNtpSv5 bV7anzEO0SVQNhs4MgSxDbHGqQqbzb2dgfILpO+54RB8qtlXAVPvNnYAsN1Qh1eR nql5FH1cGZSyx0Qhn8+VRafMyEoGDrQuiDdIJ4gjUuVpUx+huJX4DY7rDlQ00cxT OuDSgZ7ka3Hu3DfnGeRTVUzS2YVOJk6yAgOySqk73Upcw7VgR6cBVyT8pj3yjRwi dgweNOOCDfcXH13ZpxQEAkdKLPAN/2r3nBC2EJWJJmbSgZHDX0gNFTZENg61BsRV zlsU4qwb+h/QpKQJfZIDD/PAB0tvTynWPicpTKL19DTP+ZOlBNfEKqIOvtutdHdo 0AXFR5ao0Iqj8TWMdASvA3heyDqv7bEkZ+2ASCwFUn6+WxMdGZEXftaqXGnzgS4Y DN5VhToha1lTIb9ugH+Ae1cE73ibWZ19FzSYy3gWB57QDCT7tWExBQX3yKAfj5Xa PArMgJgYWmmzw3TumgDaoMr7zNvAQIhvCJbSQqimgVSvroljbq38qnH/2L4Ctvf+ R4p/f44ULjZ0l+x5VH8VJDr5nENLdGD/Nq2Grmj8USO7fDbpgbQ7jBdYiiDXjh4q BVnw1tWM+5VR2GDQtUiVudOIouyAXbwJ8hq7jPwaHVAOwiWvTtuPTrxgim1ZocIP QGx2Uz2TYmEtUe9K4jp+ =ZK/w -----END PGP SIGNATURE----- --10obl4QENaiqB4FEUMRtmhCIrS1e0VchH--