Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44829 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89920 invoked from network); 8 Jul 2009 11:06:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jul 2009 11:06:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:36914] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/62-12124-0DD745A4 for ; Wed, 08 Jul 2009 07:06:57 -0400 Received: from il-gw1.zend.com (unknown [10.1.1.21]) by il-mr1.zend.com (Postfix) with ESMTP id 3674450513; Wed, 8 Jul 2009 14:08:02 +0300 (IDT) Received: from ws.home ([10.1.10.12]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 8 Jul 2009 14:07:34 +0300 Message-ID: <4A547DCB.9090003@zend.com> Date: Wed, 08 Jul 2009 15:06:51 +0400 User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Ilia Alshanetsky CC: PHP internals References: <2D0F5226-EBCA-4B45-BF01-8ED1C643976C@prohost.org> In-Reply-To: <2D0F5226-EBCA-4B45-BF01-8ED1C643976C@prohost.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Jul 2009 11:07:35.0017 (UTC) FILETIME=[4BF6CD90:01C9FFBC] Subject: Re: [PHP-DEV] Type hinting/casting request for vote From: dmitry@zend.com (Dmitry Stogov) 1) The patch introduce several new reserved words (resource, numeric, scalar, object). This may break existing applications which use these names as function or class names. 2) The patch should define something like ZEND_ARG_TYPE_INFO() 3) do we really need IS_CLASS constant? 4) arg_info->array_type_hint should be probably changed into arg_info->type_hint. May be it's better to use bitset mask for it. Then we won't need IS_SCALAR and IS_NUMERIC as well and arg_info->allow_null field. Otherwise the patch looks good, but note that for now it only slowdowns execution a bit because of addition checks. I hope, it'll be possible to use these hints in the future to generate more optimal code. +1 for php6 after improvements Thanks. Dmitry. Ilia Alshanetsky wrote: > Last week or so there was a fairly detailed discussion on the internals > list regarding type hinting based on my original patch. Since then the > patch has been revised to address the major concerns that were > identified (breakage of binary compatibility) as well extended with > additional functionality (object hint, type casting, reflection support, > etc...). > > The final patch is available here: http://ilia.ws/patch/type_hint_53_v2.txt > The test suit is available here: http://ia.gd/patch/type_hint_tests.tar.bz2 > > I would like to ask all developers to voice their opinions of whether it > makes sense to add this to 5.3 or to throw it away (either one is fine > btw). To keep the process simple & flamewar free, please restrict > yourself to +/- (1/0), next week monday I'll run a tally of the votes > and based on the result we can determine how to proceed further. > > Ilia >