Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98903 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 640 invoked from network); 28 Apr 2017 23:05:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2017 23:05:40 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.179 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.179 mail-wr0-f179.google.com Received: from [209.85.128.179] ([209.85.128.179:35914] helo=mail-wr0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/03-01540-3CAC3095 for ; Fri, 28 Apr 2017 19:05:40 -0400 Received: by mail-wr0-f179.google.com with SMTP id l50so40546362wrc.3 for ; Fri, 28 Apr 2017 16:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:cc:from:message-id; bh=8TeCdwW444N9BkQUR9mtP1C27WZHQYLQsB3pNkDj9ZA=; b=VOerNcUS1+8GPeCq+y255Io2h9wjI9HRigJPcijXltbYFhjac/nUDXHsN8qsPbEceI orfMt70k7cq7ZDD+utsIY6JS8KsLgGlgh5BUi/nsmKt4siD1wSulsIaNa0Kcj1dF6VMO Sc/I9Lxj7M35BQUoTvk5f+kY0ef3w2EK5I1R65eEQPfuB9SUCm7KqgOI8s+7XUIYFVAF l0okufaQblotA+YkVwvvo2iKu/XRC7BDIiK6dXMe2uu8uJQdvuDWQHvKdtQXMj0UMgqh GDhtnelX0osaZUS6e32t8L2YyoKrC+j3jBYxSsg7l5oMs2ZQ06kXu/O3us7Zb+QYZ6so Weag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=8TeCdwW444N9BkQUR9mtP1C27WZHQYLQsB3pNkDj9ZA=; b=MXgCMT5n6vpK1RFwIDyAbbwxKlOce8Dl3wo2zdroC+tCau4AK0p5uimgsCoHmuLbry 8EurZAgSiC4mFXIJ738xrW3bg8k0aeUXBj2XyNNRxey2Kn+I5cFYcUTjNK7ieWIL5c1U ubFnhSLW1fKDGT52ob/Wvy9vFzlOxuFpJfQSkNGJuTesLsot65vMXX5/ATvWAdd5wpaC 5vjH5+aGQiqSg7gAYsLMOGLiWAVhLYIZK+7lf1YPFmHO1ztxJfnR1rhdygXyU/GUw4zk xsBgX/UzVFVNtDkDrHtSI4/4tp81eXWWmFm0QFjyGG8WdDDaV0vFCaR6yFZcKBlVwEgT dn7g== X-Gm-Message-State: AN3rC/4x6Gn+bMGgJ4siURoOKjkHi8YBLQdHOpHaAYu78hfwYe0NrdvS 462xjzQBcCVAEQqCpp0= X-Received: by 10.223.147.228 with SMTP id 91mr8723036wrp.47.1493420737261; Fri, 28 Apr 2017 16:05:37 -0700 (PDT) Received: from [10.61.139.48] (188.29.164.128.threembb.co.uk. [188.29.164.128]) by smtp.gmail.com with ESMTPSA id s29sm3822349wrb.21.2017.04.28.16.05.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Apr 2017 16:05:36 -0700 (PDT) Date: Sat, 29 Apr 2017 00:05:34 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: <398456D8-170A-4629-B6FF-D64F6DDB9C9A@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: Sara Golemon CC: PHP internals Message-ID: <5B258485-B7EE-4DCD-B93F-B036E9B6D4CC@gmail.com> Subject: Re: [PHP-DEV] [RFC] Enable strict_types checking for curl_setopt() From: rowan.collins@gmail.com (Rowan Collins) On 28 April 2017 22:30:35 BST, Sara Golemon wrote: >On Fri, Apr 28, 2017 at 2:29 PM, Rowan Collins > wrote: >> On 28 April 2017 18:54:09 BST, Sara Golemon wrote: >>>On Fri, Apr 28, 2017 at 9:34 AM, Markus Fischer >>>wrote: >>>> To me the intention of strict types is clearly on the functions >>>publicly >>>> visible contract, i=2Ee=2E it's reflectable parameters and not some >>>business >>>> logic hidden inside a function=2E >>>> >>>So you feel that declare(strict_types=3D1); should never apply to >>>internal functions? >> >> I don't see that assertion implied in any of the objections on this >thread=2E >> >It's implied by the statement of yours that I quoted=2E "To me the >intention of strict types is clearly on the functions publicly visible >contract, i=2Ee=2E it's reflectable parameters and not some business logi= c >hidden inside a function=2E" > >Internal functions do not have reflectable type hints (apart from >array and object), ergo by your criteria you feel that strict types >does not apply=2E Your words=2E Just to clarify, I jumped into the thread to put my explanation of what I = think people were objecting to=2E It is not my words you are quoting there,= they don't speak for me, and I don't speak for them=2E My apologies for th= e confusion=2E Personally, I don't think the literal fact of reflection not being availab= le is all that relevant either way=2E It's certainly not the objection I wa= s raising=2E >> The objection is that type checking currently only occurs at function >boundaries: > I say "somewhat", because it is not unique in this >regard, many internal functions apply varying signatures based on >initial argument and/or number of arguments=2E See pg_*() functions for >my favorite example of this, though there are several examples in >standard as well=2E Then I stand corrected=2E I was unaware that there were already internal f= unctions which performed checking that couldn't be done the same way in use= rland; specifically, that checked more than basic signatures, but only unde= r strict_types mode=2E Nor did I spot those examples in this thread, so it'= s possible that other people are also unaware of that precedent=2E But agai= n, to be clear, it may just be me=2E >> So, while I agree that checking the argument types for curl_setopt() >is highly desirable, >> I am sympathetic to the argument that strict_types should not alter >those checks=2E >> >We disagree=2E Fair enough=2E >> That leaves us with either checking the types unconditionally (a >significantly breaking change) >> or introducing a new, type-safe, API=2E >> >It also leaves us with the third option of what is presented by the >PR=2E You do not have absolute veto=2E I never claimed to have any sort of veto, I don't even have formal voting = rights, I just have an opinion=2E What I meant was "it leaves two options w= hich I would back right now, based on the reservations I just explained"=2E= Other people can back whatever options they like, including the fourth opt= ion of "no change", or ideas neither us have thought of=2E >> That could mean a small but awkward set of type overloads >> (setBool, setInt, etc), or a large set of named setters >> (setReturnTransfer, setHeaders, etc) which could use >> normal parameter hinting to interact with strict_types=2E >> >Eww=2E Eww=2E And eew=2E > >I reject the idea of making a worse API for the sake of an artificial >purity standard which has long since been violated elsewhere=2E Personally, I think if we were designing from scratch, having a setHeaders= method which took an array (and an associative one at that) would seem a b= etter API than a weird polymorphic function with a manual page a mile long= =2E Regards, --=20 Rowan Collins [IMSoP]