Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29613 invoked from network); 24 Apr 2014 17:59:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2014 17:59:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=pjsturgeon@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pjsturgeon@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: pjsturgeon@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:36581] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/81-20919-BE059535 for ; Thu, 24 Apr 2014 13:59:08 -0400 Received: by mail-la0-f44.google.com with SMTP id b8so2328817lan.3 for ; Thu, 24 Apr 2014 10:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Y4irSN6/eNuYCS1BNqVrW6f1yO27hiBPM5+EDFZQqYQ=; b=f54nBxLbnzB2OH18xoSYtPIfbQrM5/t9kCi0+u8egnAa2rjH5TdmycUbsvEcJHw0Wd R4E/CSPoK692AkWLrK05Fh9XXAr6w7TiO7wLa+gv9x5GG4YJZSzH3BOxVwQGNdhoTEXC /fepVaX2ZMO1osRxOb3XHrcICTpE4gxYU4XC5zgES+fRBEUnyCjPOH3dx/VZPB5v4uv9 aGgjTb1/+hiZdfzXEzEEigZ+jd/yVia1JFD8m8yKO2KR/AUfPW/ji7NW9aqJ/PqnqkPh tYVnwaRYIjr+i3B1pgTIYBSII5PxZTfLXJCf9YLJ3OOgILElbYo4e1b8Ro5ZA4OOCo2E bZIQ== MIME-Version: 1.0 X-Received: by 10.152.120.168 with SMTP id ld8mr2191033lab.12.1398362344854; Thu, 24 Apr 2014 10:59:04 -0700 (PDT) Received: by 10.114.199.238 with HTTP; Thu, 24 Apr 2014 10:59:04 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Apr 2014 18:59:04 +0100 Message-ID: To: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Return Type Declarations From: pjsturgeon@gmail.com (Philip Sturgeon) On Thu, Apr 24, 2014 at 4:59 PM, Levi Morrison wrote: > 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 notably > 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 gleaned > valuable knowledge from your proposals and the discussion around them. This will come in very handy over at the PHP-FIG, as we can specify return types for interface methods instead of just type hinting parameters. All for it. This has been done in a way that is fully BC, resolves any of the previous complaints, offers useful functionality, does not bite off more than it can chew, ignores the whole "nullable AND specific type" black hole and gets the job done. Best of luck with this one Levi.