Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37227 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80303 invoked from network); 25 Apr 2008 18:23:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2008 18:23:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain phcomp.co.uk designates 213.152.38.186 as permitted sender) X-PHP-List-Original-Sender: addw@phcomp.co.uk X-Host-Fingerprint: 213.152.38.186 freshmint.phcomp.co.uk Linux 2.5 (sometimes 2.4) (4) Received: from [213.152.38.186] ([213.152.38.186:64054] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/60-18287-0B122184 for ; Fri, 25 Apr 2008 14:23:49 -0400 Received: from addw by mint.phcomp.co.uk with local (Exim 4.69) (envelope-from ) id 1JpSaD-0004Wy-7U; Fri, 25 Apr 2008 19:23:41 +0100 Date: Fri, 25 Apr 2008 19:23:41 +0100 To: Sam Barrow Cc: internals@lists.php.net Message-ID: <20080425182341.GB14490@mint.phcomp.co.uk> References: <1209137410.6642.9.camel@sbarrow-desktop> <1209147362.20639.7.camel@sbarrow-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1209147362.20639.7.camel@sbarrow-desktop> User-Agent: Mutt/1.4.1i Organization: Parliament Hill Computers Ltd Subject: Re: [PHP-DEV] Return type hinting patch From: addw@phcomp.co.uk (Alain Williams) On Fri, Apr 25, 2008 at 02:16:02PM -0400, Sam Barrow wrote: > > Can anyone help me with this? > > Here is the current function declaration rule: > T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING > optional_function_return_type { zend_do_begin_function_declaration(&$1, > &$4, 0, $3.op_type, NULL, &$5 TSRMLS_CC); } '(' parameter_list ')' '{' > inner_statement_list '}' { zend_do_end_function_declaration(&$1 > TSRMLS_CC); } > > I want to move "optional_function_return_type" AFTER the parameter list, > but I also need to pass it to zend_do_begin_function_declaration. Is > this even possible? > > What I'm trying to acheive is this: > > function a($arg1, $arg2) return int { > } > > Currently: > > function a return int($arg1, $arg2) { > } Why note the following (which would be more C like): function return int a($arg1, $arg2) { } -- Alain Williams Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php Chairman of UKUUG: http://www.ukuug.org/ #include