Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98908 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41119 invoked from network); 29 Apr 2017 16:25:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2017 16:25:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.128.171 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.128.171 mail-wr0-f171.google.com Received: from [209.85.128.171] ([209.85.128.171:35974] helo=mail-wr0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/A6-01540-E8EB4095 for ; Sat, 29 Apr 2017 12:25:50 -0400 Received: by mail-wr0-f171.google.com with SMTP id l50so46902036wrc.3 for ; Sat, 29 Apr 2017 09:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=g9/mCGbZFSHQceHULV90aLur9P5ZBCMJ/j61Ro0usBE=; b=ECkUPfoKx3hvz8Ss7fLYa720nSvtxcZlS/BICl3GdbiLo25lKaJuNbnWQOk+VBiZRm ddynuyWE1X8FHUHVxkbCdeTbGXyOnqW2+9NsTFvg+t2DlA5sdasOtVPfV3rKwFMntTDJ F1Njc4hkOvia+sNpt4paKAGCfD+e7KPJQeYngDJB+xDUzbkW5ln1s/OFFfrIcWXXTegD 0Mz09LsI4Bciyzl670RxnkO4FmyagmYoV8iSKDrIdIh//12995Fb30fEtqM9QDCqVRrj EWLKpgjOUDmsq+0wn78pfVlfaNRhS/VGbHD9ND3E69VJJ3GrBeEXXjGy2tj0ujJqpjtt e3xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=g9/mCGbZFSHQceHULV90aLur9P5ZBCMJ/j61Ro0usBE=; b=NW/AogvY9DpeIbyT0c5Y/W631G/D5N3fKXZl6MvA/R1vl1O5uh2mKTUkynuHJGbkQd wQBYM+P0F89SJr+q63Y66EpHXM50xpbZ5fLbECLttvGxR9gYwlgltGEb1rMEcXL4aKRn pdVup20HPjYe3sFey7uU4sF+fEW3jKgaDdLx892CmJ2hpxM+3fgsle1C0iU0jfpMagUa dBpLYzdzdodXjHOAd8ijVLStKNLnnVpFEN9blLMv9Jr13LXF54Ti4BflPLq+y4u9YPDE 6gPLh+uuZy1+vZzwCwmARPUUtRCrhsgZA4sBzqOTSxY5Dk2s16Ijk9r3n+R1eD2UlMT4 fCOA== X-Gm-Message-State: AN3rC/6M83OPsPoM6ak/Idke3gdMLNZyy96RfXR0s55LuxSf2GligM3m PWJg3CGSSqeuBLTSRBwnOXfjx7m0PA== X-Received: by 10.223.166.226 with SMTP id t89mr12074925wrc.72.1493483146783; Sat, 29 Apr 2017 09:25:46 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.157.38 with HTTP; Sat, 29 Apr 2017 09:25:45 -0700 (PDT) X-Originating-IP: [73.9.224.155] In-Reply-To: References: <398456D8-170A-4629-B6FF-D64F6DDB9C9A@gmail.com> <5B258485-B7EE-4DCD-B93F-B036E9B6D4CC@gmail.com> <8F7D0233-DB1A-4617-8E92-C1719D4D385D@gmail.com> Date: Sat, 29 Apr 2017 11:25:45 -0500 X-Google-Sender-Auth: zyLNhvdYsJUX_w-ypYyKzQFrTnw Message-ID: To: PHP internals Cc: Rowan Collins Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Enable strict_types checking for curl_setopt() From: pollita@php.net (Sara Golemon) On Sat, Apr 29, 2017 at 11:11 AM, Fleshgrinder wrote: > Let me be Bob, and my assumption would be completely different. I expect > that internals behave the same as userland implementations. I know that > this is not the case in every circumstance, but those where this > assumption does not hold true are meant to cover very special edge > cases, like GMP. I consider many others as being ugly hacks. > Your example of GMP can't be simply dismissed as "a special edge case", it's precisely true that internals does not always follow the same rules as userspace and often it breaks those rules for very good reason. > I expect strict types to affect the arguments I pass to a routine, not > more, not less. > Agreed. And that's what this proposal suggests. If I took at your word here, I would expect you to support this RFC. > In other words, I consult the docs and if the signature states an > expected type for a parameter of a routine, I expect strict types to > validate that for me, not more, not less. The docs of `curl_setopt` > states `mixed` for `$value` and that is what I expect. > > https://php.net/curl-setopt > Again, you're weakening your own position. The PHP manual page for curl_setopt() GOES ON to state the per-option types which should be passed for $value. I expect strict types to validate that for me, not more, not less. The fact that you fail to read past the first line of the manual page doesn't invalidate the function's *total* signature. > This does not mean that it is not allowed to throw an exception if the > value is of another type, but it must not use strict types to determine > its mode. Simply because I cannot do the same in userland. > Again, false. The fact* that something can not be done in userland does not preclude doing it in internals. You mentioned one such case at the start of your reply and there are plenty others. -Sara * Pedantically: This is not even true. Using backtraces and some simple hacks, it's quite possible to determine the caller's strict_types setting from userspace. But that's going off on a tangent...