Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40682 invoked from network); 11 Sep 2015 16:00:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Sep 2015 16:00:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=korvinszanto@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=korvinszanto@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.45 as permitted sender) X-PHP-List-Original-Sender: korvinszanto@gmail.com X-Host-Fingerprint: 209.85.220.45 mail-pa0-f45.google.com Received: from [209.85.220.45] ([209.85.220.45:36849] helo=mail-pa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/70-37684-39AF2F55 for ; Fri, 11 Sep 2015 12:00:20 -0400 Received: by padhk3 with SMTP id hk3so78394792pad.3 for ; Fri, 11 Sep 2015 09:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=NZsGN/x6rRIqZZeRLxyY9mp2ux/XkGMUr9ZhaKtYhUE=; b=MIxF4+QgD3cAcMXPQtLNOFmQuqndH7G3R4kf9Vnjd5EsD4IJwAzuU5tujfW27lN6Zk V/+4X2wLkldQw9Bu7pBQEIvTSHFxwXO0NbrGEaoCHwcokC3g8omhCB8tf/y4nFBB/V2y TE8oKfaZpbThx5k/FT3UKI+amvCsET6f6/+veSvvP3c9FYIgqWNkC3EoZhxqniJm/gXW nPBiS8qvULcr6/ADnu17xZlq1eMMWik5ei6yWBQRaHTUFs3WsC2B0Iis7SECt0Cl9Dob idPgodz9k+mFUAqMzIVH8uP2GL5nlRcZHSFbwFeVG/Ai99aWE8KfRoOsm+1qtVZ66iyw LFpg== X-Received: by 10.68.129.198 with SMTP id ny6mr20217439pbb.42.1441987216821; Fri, 11 Sep 2015 09:00:16 -0700 (PDT) MIME-Version: 1.0 References: <55E4B9AA.9060906@dasprids.de> <55F20B8D.3010805@dennis.birkholz.biz> <55F20E72.6050309@dasprids.de> In-Reply-To: Date: Fri, 11 Sep 2015 16:00:07 +0000 Message-ID: To: Levi Morrison , "Ben Scholzen 'DASPRiD'" Cc: Dennis Birkholz , internals Content-Type: multipart/alternative; boundary=047d7b10cc9bd455f2051f7acf16 Subject: Re: [PHP-DEV] Generic classes and methods RFC From: korvinszanto@gmail.com (Korvin Szanto) --047d7b10cc9bd455f2051f7acf16 Content-Type: text/plain; charset=UTF-8 Levi, It's my understanding that the "type variable" is a member of the instance and not of the class. In at least java, generics are unavailable in static context[1] though they can be specifically defined on the static method itself[2]. [1] http://stackoverflow.com/questions/936377/static-method-in-a-generic-class [2] https://docs.oracle.com/javase/tutorial/extra/generics/methods.html On Fri, Sep 11, 2015 at 8:28 AM Levi Morrison wrote: > On Thu, Sep 10, 2015 at 5:12 PM, Ben Scholzen 'DASPRiD' > wrote: > > Hi Dennis, > > > > thanks for your feedback, see my answers below: > > > >> 1. static methods: > >> > >> class Foo { > >> public static function test() { > >> } > >> } > >> > >> how can I call the method: > >> a) Foo::test() > >> or > >> b) Foo::test() > >> > >> in case b), would the generic methods not be a duplication? > > > > > > Case a) is correct here. A static method is not in the context of an > > instance, so it doesn't know about the class boxing by itself. > > I think b would be correct. Can you explain this rationale a bit more? > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b10cc9bd455f2051f7acf16--