Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37256 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62741 invoked from network); 27 Apr 2008 00:11:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2008 00:11:32 -0000 Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.200.174 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.200.174 wf-out-1314.google.com Received: from [209.85.200.174] ([209.85.200.174:5129] helo=wf-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/E2-44564-4B4C3184 for ; Sat, 26 Apr 2008 20:11:32 -0400 Received: by wf-out-1314.google.com with SMTP id 27so3484258wfd.26 for ; Sat, 26 Apr 2008 17:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=tR4BbtfV05WSPBPPjlsP3la3pFGyLpt3qQjwbs1UXAc=; b=lyyu6EAtG0RZOFLMth2eT7S98kY0s1tkSVcdXmnfiixesKzYj/w5YtvN951hV0mn/vZn+lQaUDVKpqigZmxGL9lFCOFRR2o0U5xrgIxipeBff7+aJMzFPi99X1lbcXt2fuK9Wmla28PSW1JJbCmQO/MIm0TVHK/fI4vrLZMnKWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=oNxu9qiY0HzcJvA3S3uWRuNi6pCAeUDBGy+g2q4+so2gtqK39cTAaEIlJCBr3+UE6XXLCjqAkUKqGzdn1dhEkf1trVM4LqICgoK9INIwNAGrjzDTyyTtMyb/DVWhmqoCcXHkzL5S3awbZVD9xZgmTU3m69D+D3/jDkwlIGUxAwo= Received: by 10.143.16.9 with SMTP id t9mr858573wfi.107.1209255089797; Sat, 26 Apr 2008 17:11:29 -0700 (PDT) Received: by 10.142.186.20 with HTTP; Sat, 26 Apr 2008 17:11:29 -0700 (PDT) Message-ID: Date: Sat, 26 Apr 2008 17:11:29 -0700 To: "=?ISO-8859-1?Q?David_Z=FClke?=" Cc: "Nathan Nobbe" , "Alain Williams" , internals@lists.php.net In-Reply-To: <64EF98DB-DB3C-44FD-BB1B-D051932F32C6@bitxtender.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1724_28293195.1209255089793" References: <1209137410.6642.9.camel@sbarrow-desktop> <48122C14.7070705@omegavortex.net> <1209150944.20639.24.camel@sbarrow-desktop> <7dd2dc0b0804251224s750679acn169637efbd8653fa@mail.gmail.com> <1209151505.20639.25.camel@sbarrow-desktop> <20080425231305.GC14490@mint.phcomp.co.uk> <9484717D-2EC6-44FF-93C8-1A9911294AF6@bitxtender.com> <7dd2dc0b0804261524l22237b58tfb9d0a341ab77233@mail.gmail.com> <64EF98DB-DB3C-44FD-BB1B-D051932F32C6@bitxtender.com> Subject: Re: [PHP-DEV] Return type hinting patch From: chrisstocktonaz@gmail.com ("Chris Stockton") ------=_Part_1724_28293195.1209255089793 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline *cough* lambda *cough* On Sat, Apr 26, 2008 at 4:26 PM, David Z=FClke wrote: > Am 27.04.2008 um 00:24 schrieb Nathan Nobbe: > > On Sat, Apr 26, 2008 at 2:06 PM, David Z=FClke wrote= : > > > > Wouldn't the most consistent way be to omit "function" altogether when > > > using a return type hint? > > > > > > public static function zomg() { > > > return $somethingArbitrary; > > > } > > > > > > public static string foo() { > > > return $mustBeString; > > > } > > > > > > > > i think leaving 'function' in there makes sense because thats the way > > php > > currently works. > > > > Well that was my point. Functions without return type hints use > "function", to indicate that they are generic in this respect, and > functions/methods with a type hint omit it to signal the difference. Havi= ng > both would be redundant. But then...: > > > otoh, should there ever be a type "function" (e.g. for anonymous funcs) > > > down > > > the road, that'd mean trouble ;) > > > > > > > > > wow; good point! maybe if anonymous functions are ever supported the > > type > > could be capitalized as in 'Function' > > > > public function Function doStuff() { > > return function() {} > > } > > > > > Absolutely not. Right now, all PHP native types are lowercase. Can't see > why anon functions should be different. > > Actually, both ways have problems: > > public function gimmeThat() { > return function() { echo 'yay'; } > } > > is ambiguous if return type hints require omitting "function", and > > public function function gimmeThat() { > ... > } > > is just plain ugly. > > So maybe anon funcs should have a different type name :p > > > David > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > ------=_Part_1724_28293195.1209255089793--