Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82959 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11499 invoked from network); 17 Feb 2015 13:50:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 13:50:48 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:58012] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/94-19463-73743E45 for ; Tue, 17 Feb 2015 08:50:48 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id D05114B0259; Tue, 17 Feb 2015 14:50:25 +0100 (CET) Reply-To: 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'" References: <01c401d04a64$1df25470$59d6fd50$@php.net> In-Reply-To: Date: Tue, 17 Feb 2015 14:50:40 +0100 Message-ID: <024101d04ab8$b880a1a0$2981e4e0$@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIWCTr4msJ5W7DJk/lLV51yibmvdAFGYlMAAfdD1qQBWSz0JpxEm4KA Content-Language: fr X-Antivirus: avast! (VPS 150217-1, 17/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Re: Annotations in PHP7 From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) HI Dmitry, Question : in which scope do you evaluate the PHP expression ? Example : 0);> 0);> function foo($a) { ... How can you know from this that the first expression must be evaluated = at function entry, that the second one must be interpreted when function = exits, let alone the question of __RETURN__ replacement and external = switch to authorize/disable DbC evaluations. Several people rightly stated that expression would be computed at = compile time. That's a way to solve the scope question as it practically = means that expressions are evaluated in the global scope, but DbC must = evaluate its expressions at runtime. Does it mean we should write = ' 0')> ? Not very intuitive but that's probably the = only solution. Something else : I am not sure I understand, but do you intend = evaluating annotation expressions everytime you parse the file. Or would = you provide a global switch ? > Any one can use doc-block now and later, but php core won't parse = doc-blocks. It's a task for external tools. I understand. Actually, DbC is not the perfect use case for annotations. = It would be fine to find a good use case because neither of DbC, AOP, = Doctrine, or phpdoc fit so well. There comes my last question : is it so interesting and mandatory to = implement annotations in the core, instead of an extension which would = parse doc blocks when needed, and would return bare strings through a = reflection-like API ? I know most want to put annotations in the core, = but what's the real benefit, if we don't consider performance ? Do we = have use cases comparing both approaches ? The fact that we voluntarily make it incompatible with phpdoc and = doctrine 'annotations' saddens me a bit too because people used to the = current 'annotation' meaning will have to integrate that a new PHP = native 'annotation' feature, totally different from what they've been = using for years. And doctrine is not an edge-case. If there are good = reasons, why not, but I don't see them yet. =20 Regards Fran=C3=A7ois