Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80116 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38961 invoked from network); 3 Jan 2015 05:54:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2015 05:54:38 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.46 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.218.46 mail-oi0-f46.google.com Received: from [209.85.218.46] ([209.85.218.46:59383] helo=mail-oi0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/C0-32964-D1487A45 for ; Sat, 03 Jan 2015 00:54:38 -0500 Received: by mail-oi0-f46.google.com with SMTP id a3so11695434oib.5 for ; Fri, 02 Jan 2015 21:54:35 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=fCPs4P+TXBweBMww95ySHqxCpC+CO5nethU86yigSHQ=; b=rgTfk96/jKgKQNyWrRcJASiD3UeQgU1YPpwoNYXuWe9btGUbXJoGOKnl39BS8g2Rfq ZnnPiq54tZFrqgSNPp89MYpel1GCxfREayxnb3J/zJaP9Rf9x+tIEMhJAKkggy8m1dZ6 lZove1fHdpfeGMcL21XCYtUYXvzurqV2QYKrcpj1Q/vDjQLHTye5ITXsce5Flcl+L1Qu LYpOkTJ4ynQjlJwSNpsd2gGvZFMSZuQOj4sT/fr6Ta8CekoBIYmjUduZHX2EPc/vFuqg r9nCULuas4c1/1qJAv+flpmryJ8L0uggv1PeLmP0EyHBPhFPRyT32EfVER34UGJxkg4v Pjwg== X-Received: by 10.182.153.133 with SMTP id vg5mr19809516obb.20.1420264475257; Fri, 02 Jan 2015 21:54:35 -0800 (PST) Received: from [192.168.2.102] (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id m32sm26040931oik.15.2015.01.02.21.54.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jan 2015 21:54:34 -0800 (PST) Message-ID: <54A78410.3050600@gmail.com> Date: Fri, 02 Jan 2015 21:54:24 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Pierre Joye CC: Andrea Faulds , PHP Internals References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> <54A778AB.6020804@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I am not sure about that. Parameters handling is one specific case, > userland parameter handling even more. It could be a good move to do Making internal and userland parameters work differently and having scalar type errors behave differently from object type errors by having one throw exceptions and another errors looks like a mistake to me. It only makes handling errors harder as you'd have to handle two types of situations instead of one. > that as a 1st step, with this RFC. I don't think "1st step" is a good approach here. The language should provide consistent expectations, including about what happens when you pass certain data to it, including error conditions. If we have different types of error conditions between internal and userland functions, it would not be a good thing. We should make all parameter handling work the same way - so if you pass a parameter and it does not match the expectations, you know what you're getting. If it works one way to internals, another for user functions, it would only make it harder to handle. -- Stas Malyshev smalyshev@gmail.com