Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:42346 php.internals:42347 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17695 invoked from network); 19 Dec 2008 14:31:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2008 14:31:56 -0000 X-Host-Fingerprint: 82.41.135.70 82-41-135-70.cable.ubr02.grth.blueyonder.co.uk Received: from [82.41.135.70] ([82.41.135.70:23168] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 65/D5-09584-B50BB494 for ; Fri, 19 Dec 2008 09:31:56 -0500 To: internals@lists.php.net,viroteck@viroteck.net Message-ID: <494BB04C.40603@gmail.com> Date: Fri, 19 Dec 2008 14:31:40 +0000 User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 CC: Kalle Sommer Nielsen , Dave Ingram , =?ISO-8859-1?Q?Cristian_Rodr=EDguez?= , internals@lists.php.net References: <69.22.48223.7E389494@pb1.pair.com> <494A3B12.80509@dmi.me.uk> <494ABFD8.2090406@suse.de> <494ACAA8.6080600@dmi.me.uk> <494ACEAE.2090700@gmail.com> <494AD2AF.9000702@gmail.com> <2dedb8a0812181823q53a3b464oc1e2e2bd37792f98@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 82.41.135.70 Subject: Re: [PHP-DEV] Q on Primitives From: nrixham@gmail.com (Nathan Rixham) Robin Burchell wrote: > Just a random thought I have from reading over that: > > Would it not be more 'natural' to change 'function' to indicate a > method with a variant return type, and allow e.g. > > 'int somefunc()' instead of 'function (int) somefunc()' to indicate an > int return? > it would break all php code existing so far; the only real way to implement return value types would be as such public static function somefunc():int { this would allow the return type to be optional and leave all existing code functional; likewise it could be implemented for any style of php'ing, thus: #php4 style class method or normal procedural function function dosumit():int { type hints are all ready there so adding primitives /should/ be possible without any bc issues