Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80639 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2165 invoked from network); 16 Jan 2015 12:30:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2015 12:30:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.173 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:42013] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/50-00273-45409B45 for ; Fri, 16 Jan 2015 07:30:13 -0500 Received: by mail-wi0-f173.google.com with SMTP id r20so1971334wiv.0 for ; Fri, 16 Jan 2015 04:30:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=VCdbBVb0KdTQ36yXP+BWgGtHzs+VCcEwCNfG/ubYgEk=; b=R0jIRdr26gYy0i6/ZlFtHRHb+yG0yxgIbTqNwb+Lx+CmbOMSDZQxKY94rwKYMmJhqC jNPoLQPLYLyAcMzyY30jpdDSrhT1t53aG68ly5b6ZjMyFvrPCEU3OJkjsTpqWIY9uGQ0 SpLFz2pSYi7F9YPJAg1ujI5mlBqIVNzYJ+FACgZMOFY/3X7RZ6ljljLrDiLjSZkEiDVQ K/dyqwtvswm1tTUj4zsFq6nauttfq9XPm+LNfEV5jovvOMypg3XDuIfOgBD0EESfaD+e caF7ymMT4fXNCBQUlC5Ppxedd144BG2/n8aqyP0Qq4qdGuOWPZz4WYyAYBDnckUNwQ21 FuxA== X-Received: by 10.194.142.234 with SMTP id rz10mr28695777wjb.118.1421411406514; Fri, 16 Jan 2015 04:30:06 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id p9sm2830117wia.7.2015.01.16.04.30.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 04:30:05 -0800 (PST) Message-ID: <54B90431.10903@gmail.com> Date: Fri, 16 Jan 2015 12:29:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <4E2073DE-0951-498C-97BB-DDAC094F11FA@ajf.me> <9a033dd1f223f854e760924d118ab812@mail.gmail.com> <2ae0164cb9b9bf1c974d7a3c60af0466@mail.gmail.com> <6105ea99002e634373c09685310e26a6@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: rowan.collins@gmail.com (Rowan Collins) Mike Willbanks wrote on 15/01/2015 16:55: > It also means that then a library developer would > need to handle conditions on both sides (when in weak vs. strict). So I > don't really understand where the gains of this would come from and it > actually causes me concern in that what if a developer forgets to define > strict and you're entire system is built on strict. In case this hasn't been repeated enough times already: No They Would Not. As a library developer, you do not rely on strict or weak hints, you rely on the variables you receive being of the types you require. This is guaranteed in both modes. You cannot stop the user of your library doing whatever it takes to get past your validation. It is up to them to provide sane inputs to your published API, and no version of type hinting can change that. Regards, -- Rowan Collins [IMSoP]