Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81938 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15879 invoked from network); 5 Feb 2015 15:40:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 15:40:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:1581] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/81-27691-BDE83D45 for ; Thu, 05 Feb 2015 10:40:11 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 63C804B021B; Thu, 5 Feb 2015 16:36:49 +0100 (CET) Reply-To: To: "'Pierre Joye'" Cc: "'Yasuo Ohgaki'" , "'PHP internals'" , "'Dmitry Stogov'" References: <01d601d04146$6fbda4c0$4f38ee40$@tekwire.net> <020c01d0414b$2c3a1120$84ae3360$@tekwire.net> In-Reply-To: Date: Thu, 5 Feb 2015 16:40:02 +0100 Message-ID: <022801d0415a$027e0620$077a1260$@tekwire.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: AQGgxP9HPTh52uHWkGo6jLSeXRdtNAIuYisqAXiAI4oCe0Gg3wHoiozGnQDNULA= Content-Language: fr X-Antivirus: avast! (VPS 150205-0, 05/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Design by Contract From: francois@tekwire.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) De : Pierre Joye [mailto:pierre.php@gmail.com]=20 >> Yes, it makes phpdoc more tied to the engine but is it a problem ? > > And here I have to jump in and say: don't. > And remind about one of the exact purposes of annotations. Sorry, I am not sure I understand. If you're talking about the link between the engine and phpdoc comments, = I agree. It is not a job for the PHP engine. It is a job for a script = pre-processor, contained in an extension, and called BEFORE the file = starts to be parsed by the engine, not after the AST is generated. It is = very easy to pre-process PHP scripts and insert PHP code for DbC checks, = while doing the same using an AST and generated opcodes looks much = harder to me. As I told Alexander, in my opinion, phpdoc blocks already provide a lot = of useful DbC information. My objective is to extend the syntax to = support more complex directives, which are still legitimate phpdoc = information. I see both concepts as closely related. One is generating = documentation, one is generating runtime checks, but both use the same = information. About annotations, I don't know much about it, as I was naively thinking = that phpdoc '@' directives were annotations, but I understand I was = probably wrong. The only concern I have about introducing a new = annotation syntax is BC break. Cheers Fran=C3=A7ois