Re: [RFC] Traits with interfaces
| From: | Fleshgrinder | Date: | Thu, 18 Feb 2016 18:40:33 +0000 |
| Subject: | Re: [RFC] Traits with interfaces | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91275@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 2/18/2016 7:28 PM, Nikita Popov wrote:
>
> Without given an opinion on the RFC itself, this might be
> interesting for context:
>
> Ÿ
> ¶ëpoDk~#¹Í_»http://hhvm.com/blog/9581/trait-and-interface-requirements-in-hack
>
> HHVM already supports "trait Foo implements Iface" with the
> semantics that the interface is also implemented by the using
> class.
>
> Additionally HHVM supports a notion of "require implements Iface"
> which means that the using class must implement this interface.
>
> Nikita
>
They also allow *extends* that I would find useful as well.
I really like the *require extends/implements* approach because it is
very explicit like *final*.
- --
Richard "Fleshgrinder" Fussenegger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWxhAhAAoJEOKkKcqFPVVrdT0P/AuCP09l04QCp5DP0SDtJMxv
02zShunhZHGW7FNWSyNYQvoJ8HdtkuUD94L9nPry6T+J86S1sQjouTu4xuHoOMNj
gsEKYuwygfax/v8h48DzonY5dhFebNJVHUTR/7pmcxJx2MyZzKpaoeQFFieBBelP
pf0YltxlBsImDfFDXcWwDuc2pgup1AuVMvO1PTJ9jshyNdqwcukmAIWl6VvKPLYN
9uRXrAYh4CiToosgqWmfjkPYungnSd0Zlqy0V509indVQQDLo76PLgmXmmonbcDu
GzIOtnAzSq3ibDUw5E2aVjknvPXTCf3z4v0EDqyiHPOfLhbgU9x8Sdr5Plwj+OcN
64Xu+u2taZYqvcGQTszsUvlnLp6+YPz7HS0q+qqC5v5rwWDaqALoB8APSyEsHZ0S
CKHq0ES/D4dwEYpTjCpGz/ZkyydhyZQ4UIn7g4VHPiYzA/QnHQ1C5H1vGagUOQ1u
7s/9TXrNg1fvHDVFSRS6v5zU8iuXGrZJIsO7N/VHLSyCe9IVF1++/bAhaqjgcaZM
Tx7SzMZ1FVKbSbEGJstIq2onvkMMDC3hWdJItbS+ug9tG6wazhHBU/MJPpacawDL
5Xup3nhT4bB5jUJ6mBAnLSIFsG18Mc+NBrl8FwEEvx0nvXGTVJs4BNgW2f3EUpfr
axg0SDiBD/NW8jYscosj
=uXXN
-----END PGP SIGNATURE-----