Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80054 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45636 invoked from network); 1 Jan 2015 16:30:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2015 16:30:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=nek.dev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nek.dev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.179 as permitted sender) X-PHP-List-Original-Sender: nek.dev@gmail.com X-Host-Fingerprint: 74.125.82.179 mail-we0-f179.google.com Received: from [74.125.82.179] ([74.125.82.179:60107] helo=mail-we0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/9D-60454-90675A45 for ; Thu, 01 Jan 2015 11:30:02 -0500 Received: by mail-we0-f179.google.com with SMTP id q59so3535594wes.24 for ; Thu, 01 Jan 2015 08:29:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=h0Pz8XrQisMvaiz+L4Z7Jh9z3URjyV/4rNKWboY3+7Y=; b=b0RtjnbNaS33DaM/ShSF0tx6muB3goR2yIKUuJPpJRFtvzkHgrDW+Ytr0c7odX6igf 8Fr5K63a0DASOg1oUUYWLyos3jqqssXus0HD2aHVMprk6MrgGh2kFzGW88S6UvnP1yTm zkpPK5U9aauiazQHuyDCO3IAETQzYF4H9tCWEdcOasEq5cXNcdPmI/HgdXQEeUfrCXFE 7Peu9wNahI8VAJjMFO3VPCwCEwyjRWbz3IaJmAl/hyQgX4FxKf9vRGF97C8IOYGqfeou U4sskO2PjBklb26d6GiQ2wZoCcLdWn8wdUK36Ms2LTnSWKQARmauR9y++LDgXtjz16LL IVXg== MIME-Version: 1.0 X-Received: by 10.180.85.33 with SMTP id e1mr123277081wiz.61.1420129798577; Thu, 01 Jan 2015 08:29:58 -0800 (PST) Received: by 10.27.203.70 with HTTP; Thu, 1 Jan 2015 08:29:58 -0800 (PST) In-Reply-To: References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> Date: Thu, 1 Jan 2015 17:29:58 +0100 Message-ID: To: marcio3w@gmail.com Cc: Andrea Faulds , Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary=f46d044280742de53f050b99bcd8 Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: nek.dev@gmail.com (Maxime Veber) --f46d044280742de53f050b99bcd8 Content-Type: text/plain; charset=UTF-8 Woow. The compromise proposed by Marcio looks awesome to me :) . Andrea, I can understand that in the PHP logic, but IMO if the RFC does not avoid people that use code like I present before i don't think it's completely relevant. I mean, if people still use old tricks because the type hinting doesn't allow to make what they wanted, then things are not cool enough and should be re-think. And actually i say that because I see easily me still using old trick without type hinting... Becaue of this cast story. Also notice that Marcio's point could be another way, like adding something with @integer (random operator choice, do not keep that in mind) that make the check strict... Then IMO this operator will be so much used that it will not make sence that is not the default behavior. That's why the proposal of Marcio is cool to me. 2015-01-01 16:59 GMT+01:00 Marcio Almada : > The battle between strict type declarations vs coercive has been here for a > while. My problem with coercion in detriment of strictness is > that sometimes you DON'T WANT TYPE CASTING AT ALL. This new feature would > create serious impediments. So I wonder if we couldn't have both (strict > and coercive types declarations) and leave the current proposed type > hinting syntax reserved for strict type declarations? Like in: > > function(int $a, (int) $b) { > // $a will be strict > // $b will be type casted > } > > This way we can actually choose when to cast and when to be strict and both > features could be voted independently without affect each other possible > future adoptions. > --f46d044280742de53f050b99bcd8--