Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48433 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17785 invoked from network); 24 May 2010 15:39:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2010 15:39:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=danielc@analysisandsolutions.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danielc@analysisandsolutions.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain analysisandsolutions.com from 166.84.1.72 cause and error) X-PHP-List-Original-Sender: danielc@analysisandsolutions.com X-Host-Fingerprint: 166.84.1.72 mail1.panix.com Received: from [166.84.1.72] ([166.84.1.72:49769] helo=mail1.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/70-13219-89D9AFB4 for ; Mon, 24 May 2010 11:39:06 -0400 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mail1.panix.com (Postfix) with ESMTP id 8DFDD1F089 for ; Mon, 24 May 2010 11:39:01 -0400 (EDT) Received: by panix5.panix.com (Postfix, from userid 14662) id 8565F2425A; Mon, 24 May 2010 11:39:01 -0400 (EDT) Date: Mon, 24 May 2010 11:39:01 -0400 To: PHP Internals List Message-ID: <20100524153901.GA12660@panix.com> References: <7.0.1.0.2.20100522175819.0a601c68@zend.com> <65101.93.108.152.52.1274662417.squirrel@www.geleia.net> <7.0.1.0.2.20100524075150.16056330@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7.0.1.0.2.20100524075150.16056330@zend.com> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: [PHP-DEV] Type hinting From: danielc@analysisandsolutions.com (Daniel Convissor) Hi Zeev: On Mon, May 24, 2010 at 08:09:30AM +0300, Zeev Suraski wrote: > > 1. Implement the table along the lines of what it looks like now, > perhaps with minor changes. > 2. Implement identical conversion rules to the ones that exist in PHP; > That effectively turns type hinting into scalar casting operators (not > saying that's a bad thing!) > 3. Implement identical conversion rules to the ones that exist in PHP, > except for when they really suck. Namely, lose the array->scalar > conversions and silent conversions of non-numeric strings to numbers. My preference depends on what option 3 really means and what tweaks would be made to 1. I like the RFC's "list of examples" table over the recently added "zend_parse_parameters" table. Important changes to the example table seem to be: * string representations of int would be okay for int and float * string representations of float would be okay for float * _maybe_ have null and '' be okay as bool. On a side note, I hope the hinting will allow the ability to do something something like "int|null" for graceful handling of optional parameters. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409