Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92564 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91543 invoked from network); 20 Apr 2016 19:17:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 19:17:31 -0000 Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:36215] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/43-14036-BC5D7175 for ; Wed, 20 Apr 2016 15:17:31 -0400 Received: by mail-wm0-f49.google.com with SMTP id v188so216340245wme.1 for ; Wed, 20 Apr 2016 12:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=KFa4RaQv9pPoUHLyLwgw9//YLBhLap/r3ogVzhO9Oi8=; b=TlmwlbxsOYJ7ZB1PbFvyxzzQVQ/N6CLpO9XFhJLsAW9WO6JDNysgP1gkyI5gF0mO5L YliFMDO9kLPdRvqzo2i0kDkKx80MMXF2dbDqez3EAdtlvCVJUR4pJBGb23IPy3HE5eur FoP4pvcaVB7Yob2y5qJXh1EYm1ozpN5J6JqFU0rKXmKMHbF61jmFuBP1L+H9ZQDacmEB z0i4ZYecOfkZXgcCaBWOlvWy+Cgs3c9Lt8beT0Q4QAYtY/VNwuXXTqlTIzqn5VyjTZhG xA+iKvdffjMuOUzfu8J6w+3P3ezP+RTwcFOcGa0d6BUptwOfUo7xO1PrrAvt9zchadnz u4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=KFa4RaQv9pPoUHLyLwgw9//YLBhLap/r3ogVzhO9Oi8=; b=Cy7mllTgwOBkxL4gNsjU0wxYygOWvDnJPGxtnIzeDBojouN9p2R0A+fwaJAaKNmNN1 JAXxNsN6psFqd/sNat7laXxmIy4GXJfG3qKu91/14yyYO1ouxazh4mMqN1o0/TW9b2F8 YKzUduCLuwmiPBGMleKMh+gGTrStvUD6oyVCCtzfkb53bAgDViDxGTXdB90BFI4Fla51 uo2/zfWk7AIcSgQfUe+h7t8To50MqaiAdnOhF4d4znzQng+qw3lxJTn/lskhkbRs3eOX RPuIi9Le0Pz874z0buNgWrpdzFSlY4ynvKZNuSDR6XIdY0yb/CbjTvXGvyzQRaIOCbAn GC6g== X-Gm-Message-State: AOPr4FVM5+fWD67gaLgT7B9/FMwCXm9g1G+autyoLaItZZOPIKUWqMfP5Chiij/u44FmYTRsG/wfLx6UL7QXxw== MIME-Version: 1.0 X-Received: by 10.28.31.212 with SMTP id f203mr30553568wmf.69.1461179847964; Wed, 20 Apr 2016 12:17:27 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Wed, 20 Apr 2016 12:17:27 -0700 (PDT) In-Reply-To: References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> <57173859.4080501@rochette.cc> Date: Wed, 20 Apr 2016 20:17:27 +0100 Message-ID: To: Guilherme Blanco Cc: Mathieu Rochette , Josh Di Fabio , "Ben Scholzen 'DASPRiD'" , Sara Golemon , PHP internals , Rasmus Schultz , Mathieu Rochette Content-Type: multipart/alternative; boundary=94eb2c05231eca81ad0530ef7134 Subject: Re: [PHP-DEV] [RFC:generics] From: codekestrel@googlemail.com (Dominic Grostate) --94eb2c05231eca81ad0530ef7134 Content-Type: text/plain; charset=UTF-8 Thanks for you're input everyone. So far, we have read some ideas for handling upper bounds, or multiple there of. The preferred keywords appear to be either "as" or "instanceof". class Foo {} class Foo {} We would like to know for sure then if everyone is largely against the addition of an "is" keyword, in favour of one of the other two. ---------------- There is also a desire to include unions and intersections. Presently though, this feature feels tied in with https://wiki.php.net/rfc/union_types meaning if union types are approved, then generics would have to support them as well. Likewise if this feature becomes approved in generics, it would make sense to support them in regular type hints as well. ---------------- The RFC makes a reference to generic closures, which may look something like this: function my_function(callable $func) { } However, an RFC already exists which is very similar to this feature at https://wiki.php.net/rfc/callable-types As it currently standards these RFCs appear incompatible with each other (please correct me if I am wrong). My question about this is would you prefer the generics RFC exclude this part in favour of a separate or later RFC. Initially the proposal included generic arrays "array". However to ease the implementation it was decided that should be a separate feature. So we'd like to find out if everyone else feels the same way about callable types. ---------------- This RFC currently doesn't specify in detail how reflection would work. We have attempted a few API designs, but due to generic classes being ... generic, it is difficult to find a suitable way to glean information about a class in a backwards compatible manner. So we will need some help on this one. ----------------- Aside from these top issues on our own list, however does everyone feel about the proposal in general? As the RFC is still in draft, we will continue to make changes to it as more popular idea pop up, so please continue. Thanks. PS: I wasn't properly subscribed to the mailing list, so I missed a few important messages that were mailed directly to internals, but hopefully I've managed to fix that now. --94eb2c05231eca81ad0530ef7134--