Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82033 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16205 invoked from network); 6 Feb 2015 09:50:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 09:50:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:33416] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/FD-45146-75E84D45 for ; Fri, 06 Feb 2015 04:50:15 -0500 Received: by mail-vc0-f170.google.com with SMTP id kv7so4674017vcb.1 for ; Fri, 06 Feb 2015 01:50:12 -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=gflamaqgOM1HnCELIxenDrPB5SVC6SBMLx9650K80nQ=; b=K8vGfRgZBXhgfjLqrZbMVkKAvC2DaLG/clpX4QrJWOuKDuly2HtFDIAxggez1nyGkM wKZa/A64dzbjLZVQjeq6NQd5tkFH2Vl/XZmcf8T5RqCrxIrbJN3GLsw/SY3OFkZnftpH vFStx9F4E7HIxyiaJYoBlIrPqFLg2tjrKJOcL2hSIc0XrzefDoXeAzJH5zVfqj9VkFJX aYzGZFfZc3EoGA2kqgwDw5AkDmL/hNVhHhMK6rvklOvbLPvXJzuVh9Pwg/96Sf7/vCjl gZz5g2mE3e9KRqk3WRfNWmaD+kYiCCULItpWLeMNdC5uwpjVvAO/emZblwkS+XwROC0o HULQ== X-Gm-Message-State: ALoCoQlu+IcjEF/SDCjSPNOT/6uMlxPYvfKBUXpYZqyAF68TzrHHjq7EMGyJ6XsVdDHrZq44aYNy6JwGVeJv2AAl0hFS2sC/EVgu3klNN7tlyrYyMbo06w2xHkkcoQzKQ5fkAHfJ0JBw9AaikCDJSGBPeGhcDizneQ== MIME-Version: 1.0 X-Received: by 10.221.44.65 with SMTP id uf1mr1679297vcb.46.1423216212349; Fri, 06 Feb 2015 01:50:12 -0800 (PST) Received: by 10.52.74.73 with HTTP; Fri, 6 Feb 2015 01:50:12 -0800 (PST) In-Reply-To: References: <01d601d04146$6fbda4c0$4f38ee40$@tekwire.net> <020c01d0414b$2c3a1120$84ae3360$@tekwire.net> <023201d0415e$5731d800$05958800$@tekwire.net> Date: Fri, 6 Feb 2015 13:50:12 +0400 Message-ID: To: Pierre Joye Cc: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , Yasuo Ohgaki , PHP internals Content-Type: multipart/alternative; boundary=001a11c3ea3cc6acd0050e68586a Subject: Re: [PHP-DEV] Design by Contract From: dmitry@zend.com (Dmitry Stogov) --001a11c3ea3cc6acd0050e68586a Content-Type: text/plain; charset=UTF-8 Just a thought: may be we can reuse part of PHP syntax and ask standard PHP parser to do the work and provide AST. <> <> I don't know if it's possible to implement... Thanks. Dmitry. On Fri, Feb 6, 2015 at 7:04 AM, Pierre Joye wrote: > On Thu, Feb 5, 2015 at 11:44 PM, Dmitry Stogov wrote: > > This is just a brainstorming, and we are not going to provide a working > > solution tomorrow :) > > You have enough time :) > > > > I don't like phpdoc approach because we have to define, parse and compile > > new syntax for constraints. > > Would constraint be able to call other functions? include external php > > files? etc? > > For me it's an overhead. We may reuse PHP syntax. > > Last time we discussed annotation a syntax reusing PHP short syntax > for array came up. To keep it as simple as possible and let the > application deals with the contents. It sounds like a good compromise > and flexible enough. > > A possible key point is also the ability to use them while using the > same source for both 5.x and 7.x. Not sure it is technically possible > but this is something to keep in mind. > --001a11c3ea3cc6acd0050e68586a--