Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73794 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82088 invoked from network); 25 Apr 2014 09:09:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Apr 2014 09:09:32 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.177 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 74.125.82.177 mail-we0-f177.google.com Received: from [74.125.82.177] ([74.125.82.177:39047] helo=mail-we0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/91-04657-B462A535 for ; Fri, 25 Apr 2014 05:09:31 -0400 Received: by mail-we0-f177.google.com with SMTP id t60so1533691wes.22 for ; Fri, 25 Apr 2014 02:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=3L0ZuyqeTQdo+mxt/xg9pOEUoxVyC8AvRHZb7jk3ULQ=; b=iwVERrJHmFvj8BB8cV/QP6uOMO/X6UrD+qfFQRjGXldkobojl+SQwJnmGBsnSvrP6P ZhNxVkwVDBr/syqQWCuF112RsB3x/pqKzQYnNZ+aHTQw+HoLYFnmc8tyYY/6kcsc2MLd BJkeVfJDiNy1GDhjt9gu7dQJkJ2ckIloT4GWLIdioH8eW8I+sxxGRXWti7P/T3idgvpw RInjqFXxf7UE5aFjJ2GilRqyJejkUsNDotcSwF6yc9L6nCTzRLJvryln3Y2Q7K0cU3it hmUM9Lqbj6YhcyG6OeSYdr/IThLMoTg2PVTbuFmaSQ0qCKdN7iUqeWhuTpj6elmdDaL7 wuSA== X-Received: by 10.194.90.107 with SMTP id bv11mr5646774wjb.11.1398416968435; Fri, 25 Apr 2014 02:09:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.9.2 with HTTP; Fri, 25 Apr 2014 02:09:08 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Apr 2014 11:09:08 +0200 Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=047d7beb9ec0a6cf3b04f7da52cf Subject: Re: [PHP-DEV] [RFC] Return Type Declarations From: linepogl@gmail.com (Lazare Inepologlou) --047d7beb9ec0a6cf3b04f7da52cf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, 2014-04-24 17:59 GMT+02:00 Levi Morrison : > My dear Internals friends, > > I have spent the last month drafting an RFC that allows return types: > https://wiki.php.net/rfc/returntypehinting > > Notable items: > - Differences from past RFCs are summarized in the RFC: > https://wiki.php.net/rfc/returntypehinting#differences_from_past_rfcs > - The patch includes basic opcache and reflection support. It also has > phpt tests. > - Informal performance tests indicate that the patch did not fubar > performance; if desired a more detailed test can be conducted before > voting. > - This RFC does not add, modify, or remove keywords at all; this notabl= y > excludes type-hints for scalars. Supporting scalar type declarations is > outside the scope of this RFC; if you are interested in supporting scalar > type declarations please discuss it elsewhere. > > As a friendly reminder, everyone on this list is interested in developing= a > better PHP and the definitions of 'better' vary from person to person. > Please be civil and constructive while discussing this RFC. Thank you! > > Some thanks, regardless if the RFC is accepted: > - For providing a patch: Joe Watkins. > - For helping me iterate on RFC drafts: Bob Wienand, Nikita Popov and > Anthony Ferrara > - For previous RFCs on this topic: Felipe Pena and Will Fitch. I gleane= d > valuable knowledge from your proposals and the discussion around them. > This is a nice and well thought proposal. I would like to suggest the addition of the "self" and "static" pseudo types. Most IDEs support this through @return syntax: class Foo { /** @return static */ public function SetBar( $bar ) { // ... return $this; } } With the new syntax, the above could be transformed into this: class Foo { public function SetBar( $bar ) : static { // ... return $this; } } Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel --047d7beb9ec0a6cf3b04f7da52cf--