Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98865 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88777 invoked from network); 24 Apr 2017 22:50:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2017 22:50:37 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 74.125.82.54 mail-wm0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:37685] helo=mail-wm0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/F4-36901-C318EF85 for ; Mon, 24 Apr 2017 18:50:37 -0400 Received: by mail-wm0-f54.google.com with SMTP id m123so80946983wma.0 for ; Mon, 24 Apr 2017 15:50:36 -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=D0CsafPw6AhE54W3T5N0ovBVskrZgxa4dkrUgx2dyow=; b=qqZEk/BxNwpAhdov21acuzzrHsUPN1hTkudv42gcoFIWMagYFmKjSVEOVyisphzONi 6fXGA/4dvNK6+gKYWNEgtk4Y5Im9XkbKMjPDvWtMNjWLc/dpWO1vD1RjVok1lEnKYw8D NiT/EOAw0xcbH5v9qVXc076ByI3buDfkvSqv3tiM9rjo81bfX1oKTSZZdf3nSRuz/QmN er9H88jtsbx0u+eIY0X8xdmo7fOu2U2XelvoXUzBwXaWhtCIpdjrNZr515+Fere5Ij6M BiE+AsswAT3PPW/szvsDBBa0lZCQ+gsUZq5b0+UfPiAB0rhMEUYGIwHeQvm+17Pvklji vtwg== 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=D0CsafPw6AhE54W3T5N0ovBVskrZgxa4dkrUgx2dyow=; b=GNmb9NKgseDmxPGL15pUINdACGd8RcglhuzmbR4pmmlfzzml7m7h9ZNjaLENISTTzE a/n3q+05V1fZdrWXG6tvyUqPNEJjwsjyqvGX8R57bQRQjmqw/BswCWbLCtKTLOdV3btK Nd7bAPQdgoNyAlHOBwAGYTaGwu+Pl2qYWCP9123/OicX+V9/ND7kP0zCNMrUGgWrPP3A 2ZWPIaP6viehdaDQM85cQzKLBhsfPR4o0yuZ88tlhbKszIzKq2kQJdhHyW/SDq1X9DFR jJaITXm3nPBy/a39rckwXwGSAW7bbTsSSlz6YN4GFxt6NiUYpFAJBx1k42iD+pHJF7nb 8fSQ== X-Gm-Message-State: AN3rC/7amW4P9uFqTivFMZcYK2BVZJDw7QQubBkrh63IPBqdUnhHeyei hpcBYAZ7c5G79Rd6Rs9CRiKnAlntHg== X-Received: by 10.28.208.74 with SMTP id h71mr10612914wmg.36.1493074233357; Mon, 24 Apr 2017 15:50:33 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.157.12 with HTTP; Mon, 24 Apr 2017 15:50:32 -0700 (PDT) X-Originating-IP: [50.197.186.161] In-Reply-To: <82da5975-aaca-580c-50ae-0b034d14b124@fleshgrinder.com> References: <82da5975-aaca-580c-50ae-0b034d14b124@fleshgrinder.com> Date: Mon, 24 Apr 2017 15:50:32 -0700 X-Google-Sender-Auth: wKnBcoRk1VWJelV6zkd6uv8PvDI Message-ID: To: PHP internals Cc: Stanislav Malyshev , "Colin O'Dell" 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 Mon, Apr 24, 2017 at 1:24 PM, Fleshgrinder wrote: > On 4/24/2017 10:20 PM, Stanislav Malyshev wrote: >> Hi! >> >>> 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. >> >> 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, this >> is internal function business logic, and I am not sure confusing the two >> is really that good an idea. >> > > 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. > I disagree. From the user's perspective it is argument typing. The internal implementation detail of that argument type being dependent on another arg's value is just a detail. -Sara