Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57030 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66492 invoked from network); 22 Dec 2011 20:05:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2011 20:05:19 -0000 Authentication-Results: pb1.pair.com header.from=will.fitch@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=will.fitch@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: will.fitch@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:47021] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/32-12618-F7D83FE4 for ; Thu, 22 Dec 2011 15:05:19 -0500 Received: by qcsd16 with SMTP id d16so5578931qcs.29 for ; Thu, 22 Dec 2011 12:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=blNwCuGiqnSP2Fv7k5wM/ngvpoMnnXKHwj8BMpKBKAQ=; b=OhDzRKa9YrfH61IHcVGwhwK+YXFSQWIlx7d/zf/BlyZxpzDKtfC4Lc2JJXCm+qnxV1 ziB6rT+o3KCo5yHCW9Tevon+hs8yBGAdtot38ThiT3AbIrp9/Bh5P3cNtAQJk2iKwzpA 0PzKhdx/uoJLtv+49OjTyduMS1eBIupBtYRbM= Received: by 10.229.111.203 with SMTP id t11mr1002343qcp.3.1324584316305; Thu, 22 Dec 2011 12:05:16 -0800 (PST) Received: from [192.168.1.68] ([68.64.144.221]) by mx.google.com with ESMTPS id m4sm17073516qan.5.2011.12.22.12.05.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Dec 2011 12:05:14 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii In-Reply-To: <4EF38A75.40009@mohiva.com> Date: Thu, 22 Dec 2011 15:05:13 -0500 Cc: PHPMailingList Content-Transfer-Encoding: quoted-printable Message-ID: <3BAFA90B-8A32-482D-B48B-1BF409CEA383@gmail.com> References: <4EF38A75.40009@mohiva.com> To: Christian Kaps X-Mailer: Apple Mail (2.1251.1) Subject: Re: [PHP-DEV] Scalar Type Hint From: will.fitch@gmail.com (Will Fitch) That's the way to do it. If you have an idea, such as this, write it = up, and let's discuss. If we don't, we end up talking about things = (like scalar type hinting) that has been beaten to death on more than = 100 occasions (sarcasm, but not really...). We can then have a = reference to point to showing that the discussion is dead. After 6 = months, feel free to bring it up again. On Dec 22, 2011, at 2:52 PM, Christian Kaps wrote: > Hi internals, >=20 > someone in the "Return Type Hinting for Methods RFC" thread had the = idea of a "numeric" type hint. I will capture this idea and propose a = "scalar" type hint. I understand the problem of the current discussion = about scalar type hints(int, float, string, double, ...). But there = should be a possibility to define a "scalar" type hint to restrict = arguments to scalar types. >=20 > function setName(scalar $name) {} >=20 > class Foo { > public function __toString() {} > } >=20 > setName(1) // pass > setName(true) //pass > setName('Christian') // pass > setName(new Foo) // pass > setName(array()) //fail > setName(new stdClass) //fail >=20 > Why this isn't possible? >=20 > Christian >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20