Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82820 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83861 invoked from network); 16 Feb 2015 11:36:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2015 11:36:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 74.125.82.50 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 74.125.82.50 mail-wg0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:35001] helo=mail-wg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/61-05176-956D1E45 for ; Mon, 16 Feb 2015 06:36:57 -0500 Received: by mail-wg0-f50.google.com with SMTP id l2so28817675wgh.9 for ; Mon, 16 Feb 2015 03:36:54 -0800 (PST) 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:content-type; bh=AVSq9rwBjvad5wSJlQH1X/24UxINAlKM6eBKMa704tw=; b=Me97iJEhXvK/oraSY8BwI5x+DY2TfXl6bTYDGNroI5NiiR7hRkbvnQKleKbLzdThzK jWvfhCLXI5B2hg2d2OyUu7naZwvm/dCYy91g8i1qSmth3w/tukFLdLkPCzh7r42SnpXc TcusQAZdemCAlIkwrsuAuyO2IPNO0BTxddR07i4M0Z83eWvsEwl+OfrKC9n4jqauRb3b HYNvB5BU+G0zU4LjmRggnQODdUg7r63qnT+FMd/aqKlRdIpTs542SjYWr/ofNCA2fZzW fxNL5/I/ab5E3mnAQX9kEXNoExWriYoasw20n4tXO0hEW3CCtoTNeK4wesPJOntnNXNG /9hQ== X-Gm-Message-State: ALoCoQk7YFRufm4X98d7Vr1xdJw+w5mAIo8V7QxWsldzXAljDr/W27+FBRWB9YTxu1cy4/XvQto6 MIME-Version: 1.0 X-Received: by 10.180.106.103 with SMTP id gt7mr3623000wib.59.1424086614735; Mon, 16 Feb 2015 03:36:54 -0800 (PST) Received: by 10.194.192.202 with HTTP; Mon, 16 Feb 2015 03:36:54 -0800 (PST) X-Originating-IP: [93.129.131.180] In-Reply-To: References: Date: Mon, 16 Feb 2015 12:36:54 +0100 Message-ID: To: Dmitry Stogov Cc: PHP Internals , Nikita Popov , Guilherme Blanco , Pierrick CHARRON , Alexander Lisachenko , Pierre Joye , Zeev Suraski , Andi Gutmans , Joe Watkins , Yasuo Ohgaki , Sebastian Bergmann , Stanislav Malyshev , Rasmus Lerdorf Content-Type: multipart/alternative; boundary=f46d04428f44cd128e050f3300d6 Subject: Re: [PHP-DEV] Annotations in PHP7 From: kontakt@beberlei.de (Benjamin Eberlei) --f46d04428f44cd128e050f3300d6 Content-Type: text/plain; charset=UTF-8 On Mon, Feb 16, 2015 at 12:07 PM, Dmitry Stogov wrote: > hi, > > 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... > oh please yes, yes yes :-) I don't care for the syntax, although this looks ok. One question, when does the php expression get evaluated? > > Thanks. Dmitry. > --f46d04428f44cd128e050f3300d6--