Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44834 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3323 invoked from network); 8 Jul 2009 12:28:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jul 2009 12:28:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain prohost.org from 209.85.198.231 cause and error) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 209.85.198.231 rv-out-0506.google.com Received: from [209.85.198.231] ([209.85.198.231:38185] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/C4-12124-601945A4 for ; Wed, 08 Jul 2009 08:28:55 -0400 Received: by rv-out-0506.google.com with SMTP id g37so1287426rvb.7 for ; Wed, 08 Jul 2009 05:28:52 -0700 (PDT) Received: by 10.140.192.14 with SMTP id p14mr4488631rvf.166.1247056132246; Wed, 08 Jul 2009 05:28:52 -0700 (PDT) Received: from ?192.168.1.169? (TOROON63-1176059019.sdsl.bell.ca [70.25.60.139]) by mx.google.com with ESMTPS id l31sm8734777rvb.33.2009.07.08.05.28.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Jul 2009 05:28:51 -0700 (PDT) Cc: PHP internals Message-ID: <2F8379C4-6042-4E5A-A298-A5E8C5A97DAC@prohost.org> To: Dmitry Stogov In-Reply-To: <4A547DCB.9090003@zend.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Wed, 8 Jul 2009 08:28:49 -0400 References: <2D0F5226-EBCA-4B45-BF01-8ED1C643976C@prohost.org> <4A547DCB.9090003@zend.com> X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] Type hinting/casting request for vote From: ilia@prohost.org (Ilia Alshanetsky) > 2) The patch should define something like ZEND_ARG_TYPE_INFO() Yeah, that can be used or existing macros can be retained using "type" parameter, which can even made BC compliant by using new sets of constants that match the IS_ARRAY or "not hint" semantics. > 3) do we really need IS_CLASS constant? Only because there is a class hint (currently supported) function foo (StdClass $foo) {} and there was a request to support a generic object hint. So one became IS_CLASS and one is IS_OBJECT. > 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. Originally that is how I had it, but to avoid BC break I've renamed the property back to type_hint. > > 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