Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82897 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53635 invoked from network); 16 Feb 2015 22:25:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 22:25:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.47 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.47 mail-qa0-f47.google.com Received: from [209.85.216.47] ([209.85.216.47:57073] helo=mail-qa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DC/B2-36518-25E62E45 for ; Mon, 16 Feb 2015 17:25:22 -0500 Received: by mail-qa0-f47.google.com with SMTP id v10so24036860qac.6 for ; Mon, 16 Feb 2015 14:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=0Nq7YtFPddATuglFI6irlRFz9vDU7Y/Qkd5fbYQuLpM=; b=pRF7i8VVoy2W/0SS93Va0TEFknRMYUDLQJsa5HOzFgXW3uuuBrHl17yUZzba45MXOj iScvehi0yoyaCXIGmylxq1uEVYfTgiAmM/otiENEnLC6wv2FLsTry0GaXcJExuXBgNf4 B4KK9Zz1C+6viM70RkvWjHqtCp/FpNTWcHivry2TBZ+pZY1ZOQ1ViaVIbwZrHwcx80Lm uXYz3PZxKSisrD3/G61iSIG8cttLPZ3Cbr5lCsoVuaNvqgV34iAhRLwOMBeBuX4OpCtS hLwHNR26+Lj5gZmSv5F9d4sUI9XE7a7qCapFtyQ2RRXwzRC7IDDFsk5L+FdE2qsd5Lv6 ECrA== X-Received: by 10.140.232.84 with SMTP id d81mr25778qhc.15.1424125520190; Mon, 16 Feb 2015 14:25:20 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.198.8 with HTTP; Mon, 16 Feb 2015 14:24:40 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Feb 2015 07:24:40 +0900 X-Google-Sender-Auth: tv9k9dCPPUo3Ot36UeJxvs_vU2M Message-ID: To: Dmitry Stogov Cc: PHP Internals , Nikita Popov , Guilherme Blanco , Pierrick CHARRON , Alexander Lisachenko , Pierre Joye , Zeev Suraski , Andi Gutmans , Joe Watkins , Sebastian Bergmann , Stanislav Malyshev , Rasmus Lerdorf Content-Type: multipart/alternative; boundary=001a11c1193ebf40ed050f3c0f1b Subject: Re: Annotations in PHP7 From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c1193ebf40ed050f3c0f1b Content-Type: text/plain; charset=UTF-8 Hi Dmitry, On Mon, Feb 16, 2015 at 8:07 PM, Dmitry Stogov wrote: > During discussion of different ways of implementing "Design by Contract" > we got an idea of using annotations. > > BTW: annotations are useful by their own and may be used for different > purposes. Support for annotations was proposed long time ago: > > https://wiki.php.net/rfc/annotations > https://wiki.php.net/rfc/annotations-in-docblock > https://wiki.php.net/rfc/reflection_doccomment_annotations > > HHVM already implemented similar concept > > http://docs.hhvm.com/manual/en/hack.attributes.php > > I made a quick and dirty PoC that shows how we may implement annotations > in PHP7 and how powerful they may be : > https://gist.github.com/dstogov/dbf2a8f46e43719bd2c2 > > The test there is self explainable. Of course, annotations just provide a > way to add metadata, but doesn't define attribute names or the ways they > are going to be used. Only Reflection API to read. > > There are still a lot of technical problems that have to be solved. > Right now, we just need to answer a question - if we like this in PHP7? > Thought and opinions are welcome... > I also would like to introduce AOP in the future. (or with it) I thought something like https://github.com/AOP-PHP/AOP is good, but we may use annotations. With annotations, we must define pointcut/etc manually, but AOP by annotation is more flexible than AspectJ. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c1193ebf40ed050f3c0f1b--