Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82032 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14650 invoked from network); 6 Feb 2015 09:46:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 09:46:46 -0000 Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; 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:62929] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/AD-45146-48D84D45 for ; Fri, 06 Feb 2015 04:46:46 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 137CF4B02BF; Fri, 6 Feb 2015 10:43:20 +0100 (CET) Reply-To: To: "'Ivan Enderlin @ Hoa'" , References: <01d601d04146$6fbda4c0$4f38ee40$@tekwire.net> <020c01d0414b$2c3a1120$84ae3360$@tekwire.net> <022801d0415a$027e0620$077a1260$@tekwire.net> <54D47160.7050206@hoa-project.net> In-Reply-To: <54D47160.7050206@hoa-project.net> Date: Fri, 6 Feb 2015 10:46:35 +0100 Message-ID: <02d201d041f1$cc6b6b20$65424160$@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: AQGgxP9HPTh52uHWkGo6jLSeXRdtNAIuYisqAXiAI4oCe0Gg3wHoiozGASPCRd4CI1BASwHipMbhAf9uW42cyLc20A== Content-Language: fr X-Antivirus: avast! (VPS 150205-1, 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 : Ivan Enderlin @ Hoa [mailto:ivan.enderlin@hoa-project.net] > > Exactly, phpdoc is used as annotation (or comments with some similar > > syntax) but is definitively not aimed to be annotations. > Exact. Annotations !=3D=3D comments. Because PHP has no annotation = system, > we used to use comments for this purpose, but it's a workaround. It seems this discussion about DbC cannot remain on the DbC subject = itself. Some claim we shouldn't add DbC because it would require a 'new = language' (I don't see where...). Now, the discussion is about = annotations, which are another subject as we don't need this to = implement DbC. Well, annotations would be nice, but I won't wait for = annotations to propose DbC ! What we need is to make an extension able to get control from the engine = in 3 locations : - when a script file is read, before any parsing takes place. The file = won't be modified but the extension will use that to read and = internalize the constraints associated with the different script = elements. - When a method or function is called, after arguments are received, and = before the function body is executed. There, we will execute the = pre-conditions. - Just after function return, but still in the function scope. There we = will execute post-conditions. Class conditions (invariants) are added to pre/post-conditions when = appropriate. Maybe this is already possible from a Zend extension, I don't know. But, = even some of these hooks don't exist yet, they shouldn't be that hard to = implement. Fran=C3=A7ois