Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80031 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66152 invoked from network); 31 Dec 2014 21:12:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2014 21:12:53 -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.218.43 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.218.43 mail-oi0-f43.google.com Received: from [209.85.218.43] ([209.85.218.43:44135] helo=mail-oi0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/E0-60454-4D664A45 for ; Wed, 31 Dec 2014 16:12:53 -0500 Received: by mail-oi0-f43.google.com with SMTP id i138so32297405oig.2 for ; Wed, 31 Dec 2014 13:12:49 -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=BgA0zRsTYVLmmRznaewX5EvFcLpFX8kRVni9vvt6TS0=; b=iWVZnAyviarK2wK7NJooZ3BlFbNdrpGjrwFsvX4qTQJ9iBzOmD7+WFBlDgkiLcjDpK 7IAHEMg7tHROIlq0hcxFFXZsCphvryysikTzgjHbmqW9tcvsv2k6EiWBP3H89pkVWa2c 4dvHOC0Jy3QdUjKHZ5dPSUkWwkhikbRTlymXr176qrSwB6+kZ9suFViDh1ZA12/Ewbyh oJLeQe26dNCRKXkGT/9/ELANfMafr+IV00f9Gr7xVx/OMJdob3gNRFivHq7UYeHcku2B Cj1GNfyPLU2kIo4hYM/6ySgkPrweINOjhDpTfGgTM5sz/8VFDjxcA+zK3KXEeIqVVRhB v2SA== X-Received: by 10.202.169.200 with SMTP id s191mr38272140oie.7.1420060369877; Wed, 31 Dec 2014 13:12:49 -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 l200sm14654600oig.26.2014.12.31.13.12.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Dec 2014 13:12:49 -0800 (PST) Message-ID: <54A466CB.9020400@gmail.com> Date: Wed, 31 Dec 2014 13:12:43 -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: Andrea Faulds , PHP Internals References: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> In-Reply-To: <41D5BB0B-73AF-488E-968D-90B2878E3178@ajf.me> 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 like it, it's consistent and to the point. If we must have scalar typed parameters (I'm not sure but if we do), IMO that's the way to do it. The issue is the class names though. E.g. see: https://github.com/ralphschindler/zf2-db/blob/master/research/ColumnType/Integer.php and: https://github.com/canaydogan/ObjectValidator/blob/master/src/ObjectValidator/Validator/Int.php These are uppercase "I", but class names are not case-sensitive... So we'll need to figure it out. Unfortunately, looking at github, disallowing "class Int" looks like pretty bad idea. We can make it lowercase-only, but this would be a bit weird since it's not sensitive in all other places (unless we change that which is another huge can of worms). BTW, right now this code: function foo(integer $a) { var_dump($a); } foo(1); produces this message: Catchable fatal error: Argument 1 passed to foo() must be an instance of integer, integer given which is pretty confusing I'd say :) We'd probably want to rephrase that message (yes, I know, patching all those tests yet again...) -- Stas Malyshev smalyshev@gmail.com