Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75591 invoked from network); 10 Aug 2010 22:32:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2010 22:32:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:39413] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/C4-61991-C73D16C4 for ; Tue, 10 Aug 2010 18:32:29 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 3F96710D0D5 for ; Tue, 10 Aug 2010 23:32:26 +0100 (BST) Date: Tue, 10 Aug 2010 23:32:26 +0100 (BST) X-X-Sender: derick@kossu.derickrethans.nl To: Internals In-Reply-To: <1281478269.6608.292.camel@guybrush> Message-ID: References: <1281478269.6608.292.camel@guybrush> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-995982474-1281479546=:29410" Subject: Typehints (was Re: [PHP-DEV] Annoucing PHP 5.4 Alpha 1) From: derick@php.net (Derick Rethans) --8323329-995982474-1281479546=:29410 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 11 Aug 2010, Johannes Schl=C3=BCter wrote: > On Wed, 2010-08-11 at 00:03 +0200, Kalle Sommer Nielsen wrote: > > type hinting >=20 > For the record: I consider the current implementation as (one of) the > biggest mistakes in the last ten years. I will try to sum up my view point once more: 1. right now we *have* strict type checks for classes and arrays in the=20 form of "classname" or "array" 2. the strict scalary type hint patch reuses this same syntax in the=20 form of to do the same thing in function arguments 3. we have casting type hints in the rest of the code in the form of=20 "(int)". Some people don't like strict typehints, but the syntax as it currently=20 is regarding type hints is *consistent*. Now, to allow both strict and=20 casting hints, the logical step seems to be, to give the weak typehint=20 advocates their tool as well: 4. We add casting typehings to function arguments in the form of "(int)"=20 so that that is consistent as well. We would need to figure out=20 whether we want: a. warnings on conversions (my choice) b. no warnings This: - keeps the syntax consistent - allows both strict and weak typehints Should make everybody happy (enough), right?=20 regards, Derick --=20 http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug --8323329-995982474-1281479546=:29410--