Re: Return type hinting patch

From: Date: Fri, 25 Apr 2008 18:23:41 +0000
Subject: Re: Return type hinting patch
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-37227@lists.php.net to get a copy of this message
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 <std_disclaimer.h>

« previous php.internals (#37227) next »