Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80610 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18043 invoked from network); 16 Jan 2015 01:42:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2015 01:42:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.176 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.214.176 mail-ob0-f176.google.com Received: from [209.85.214.176] ([209.85.214.176:47120] helo=mail-ob0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/A3-33406-C6C68B45 for ; Thu, 15 Jan 2015 20:42:06 -0500 Received: by mail-ob0-f176.google.com with SMTP id vb8so16842143obc.7 for ; Thu, 15 Jan 2015 17:42:01 -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=hUCDMihOfJG5485/Ks3rbCXqMHneIjmqqLcodcswLw0=; b=yeUvdQOL8Wvl98APE+qlV3lXl+/QWwXMczCSEVjodHFEAo5ZdtG4kDCXlmPp3c1I2u TrAgAno0ZbXxaT6b9osllWqXScllN2YPgfjGasEHR2eYPpi+rxJjCYqYpTtzPUa4i4qC pnZMYEdDVMvX3LZINmQTVBhpE4yNtrJVgKTgq0JAHm4Ys3wU8muJUk4dlMQYe2pLqdF+ +kQ0vH5iSwNhmwYaxHe9Cia3g/8XNSZoEZbEECM8W4D1q2V7nYLtJC5QqqZH/zYjzuw9 xRbuChJMyRmcEeI1YSJEDrLTewMPcHXfHm/HgVQI0zCxcNWxKL+2lLZuPiH+P+3IP3KW YRfA== X-Received: by 10.60.175.195 with SMTP id cc3mr8041909oec.10.1421372521242; Thu, 15 Jan 2015 17:42:01 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ib6sm915215obb.10.2015.01.15.17.41.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jan 2015 17:42:00 -0800 (PST) Message-ID: <54B86C63.6070802@gmail.com> Date: Thu, 15 Jan 2015 17:41:55 -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: marcio3w@gmail.com CC: Andi Gutmans , Andrea Faulds , Zeev Suraski , Richard Quadling , Leigh , PHP Internals List 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> <85F6139E-6332-4645-91B8-C852B07EA62A@ajf.me> <12433808-9D62-48D3-B66E-74572C61BF68@zend.com> <54B85C2B.9000901@gmail.com> <54B86134.1020801@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > detriment of coercive types simply because there is no general > consensus about what "strict" means :) I don't see any place for "consensus" and "non-consensus" here - unless you want to redefine words to have arbitrary meanings so nobody understands you, it is pretty clear what "strict" means - typing system in which the variable marked with certain type accepts only value of that type and nothing else. What other definition could you have in mind? > But I also don't want to have coercive type hints to occupy the best > "syntax slot" that could be used for more strict type checks That's fine that you want your use case to be most convenient for you, unfortunately that place has been already taken for years. > debate. I'm just claiming that `(int) $num` is more explicit, has no > BC breaks and should, IMMO, be the preferred choice. No, it should not be, and I just wrote two mails explaining why exactly it should not. Here's the third. > Sorry, but this is the syntax used by the manual to describe functions > usage, not the actual implementation. The manual can be updated. The Of course, we can rewrite the whole manual and the whole language. The question is - why we should make such huge changes if we already have this meaning and it has been there for years and it always meant exactly that - coercive typing for scalars - and never meant anything else? > implementation itself can't be changed after major version release. The manual is what people read and rely on. But there's a bigger issue that you keep ignoring - that the functions having scalar typed argument *are* coercive *right now*. You describe it as if it's a typo in the manual that can be fixed or something that happened by accident and nobody intended it. Nothing can be further from the truth - it's how weak typing has been always working in PHP. You want new feature for your use case? Fine, but claiming existing syntax for it and saying "no problem we'd just rewrite the whole manual and disregard 20 years of PHP history" sounds like a bit too much to ask. -- Stas Malyshev smalyshev@gmail.com