Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20554 invoked from network); 19 Dec 2008 14:37:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2008 14:37:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=surreal.w00t@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=surreal.w00t@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.152 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: surreal.w00t@gmail.com X-Host-Fingerprint: 72.14.220.152 fg-out-1718.google.com Received: from [72.14.220.152] ([72.14.220.152:43243] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/76-09584-BB1BB494 for ; Fri, 19 Dec 2008 09:37:48 -0500 Received: by fg-out-1718.google.com with SMTP id 16so377829fgg.23 for ; Fri, 19 Dec 2008 06:37:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :sender:to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=mba+cjQuGLvCw4sg+RRqN84lRUrAHbkiJ7JldPY9X9E=; b=BOdU49kI+m6NW6rAj3XZp9C3kTpWJgLQQBCSEXzCCTV0qXydZ23iPR8aDl6jPZ7waf nEpeBMyaHTuyHJs7huO9iqCw19vioPx31CE3XCzu6UwMzPYQTGcsHuWVoXD0JtZwxo73 a3W0/T0qaWlnHiz4H9FHRTDowv0N/AC5gpa7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references:x-google-sender-auth; b=Zek5jdedMKIYGJxUV6TH6fYDSrDim23al6VgmQ42kCSbscVUq5iJbYDPR5tX7T2pA0 6800G/HdiBwWtNb0Ee3DdKQvhfamLViG5ah+V6EgC8w3BgBfUpu5cVBgLjcjx+6+u/Ub y7BJrdYfvZUnzM/J0ViDnctjGe9ofG/0DxPu4= Received: by 10.86.23.18 with SMTP id 18mr1854656fgw.6.1229697464472; Fri, 19 Dec 2008 06:37:44 -0800 (PST) Received: by 10.86.87.15 with HTTP; Fri, 19 Dec 2008 06:37:44 -0800 (PST) Message-ID: Date: Fri, 19 Dec 2008 14:37:44 +0000 Reply-To: viroteck@viroteck.net Sender: surreal.w00t@gmail.com To: "Nathan Rixham" Cc: internals@lists.php.net, "Kalle Sommer Nielsen" , "Dave Ingram" , "=?ISO-8859-1?Q?Cristian_Rodr=EDguez?=" In-Reply-To: <494BB04C.40603@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> <494BB04C.40603@gmail.com> X-Google-Sender-Auth: d37b1ead56191280 Subject: Re: [PHP-DEV] Q on Primitives From: viroteck@viroteck.net ("Robin Burchell") Hmm. How would it break it? By leaving 'function' to mean variant, it's only adding new functionality by overriding types to replace 'function', which should have no issue with older code, surely? To clarify: current method declaration: function foo() public static function foo() public function foo() .. and so on new method declaration could stay the same, if the author didn't care about return type, or: int foo() public int foo() .. etc. The only possible issue I can see is where e.g. there is a class named 'static', which, IIRC is already impossible. If I'm missing something, please let me know :) On Fri, Dec 19, 2008 at 2:31 PM, Nathan Rixham wrote: > 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 > >