Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80053 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44175 invoked from network); 1 Jan 2015 16:27:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2015 16:27:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=irker@irker.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=irker@irker.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain irker.net from 209.85.212.173 cause and error) X-PHP-List-Original-Sender: irker@irker.net X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:62489] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/4D-60454-17575A45 for ; Thu, 01 Jan 2015 11:27:30 -0500 Received: by mail-wi0-f173.google.com with SMTP id r20so26801292wiv.6 for ; Thu, 01 Jan 2015 08:27:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=K1whd8VHA/tw73z8/y6mSXXSEz8lhASS5+hnYUQLcBI=; b=LgryvdrqhMMAd/eX9sRW3aNYLprotAMg2zYOPjY43XQBFX40hREvhmfDdqRsPXINoI skichZqw+TQGgRazu0jF+7JgrsvORIgIG8K5bxB2rjqrA6cgfTzD0SH9O6oo6Zc9YesG lU82C0Z9UGK2N5vdbasfn3In/03xGpZnX19OkZEFyeTGfylkdoizlD/B3J0VzONMxsZ0 QwvX1hykoBeFalRBPQrMAEspX5Ga8i5k4ykvHXULAQ1fO0Ri5UXMgw7ksIEpGSpJaG2m M+cfaE0/KQkQvHpe/g+eFPm1ERRcC6M3ocbTRCLu/fZktCsofOaoYcuxKWwmUZ4qaS/I cuMg== X-Gm-Message-State: ALoCoQky3nM/X/bWi1ucXF/HvGdspv0YBNGB1kSC0ZqpsH87hRClb6YeQyJAUFu6eWFZKvY0ZS93 X-Received: by 10.194.89.3 with SMTP id bk3mr144509505wjb.92.1420129645561; Thu, 01 Jan 2015 08:27:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.27.175.92 with HTTP; Thu, 1 Jan 2015 08:27:05 -0800 (PST) In-Reply-To: References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> Date: Thu, 1 Jan 2015 20:27:05 +0400 Message-ID: To: marcio3w@gmail.com Cc: Andrea Faulds , Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary=089e0102ee020f21ad050b99b3ec Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints From: irker@irker.net (Alexander Moskalev) --089e0102ee020f21ad050b99b3ec Content-Type: text/plain; charset=UTF-8 genius and simple syntax! int $a === assertInt($a) (int)$a === (int)$a 2015-01-01 18:59 GMT+03: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. > -- With regards, Alexander Moskalev irker@irker.net irker@php.net a.moskalev@corp.badoo.com --089e0102ee020f21ad050b99b3ec--