Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82004 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46898 invoked from network); 6 Feb 2015 04:04:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 04:04:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.51 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.51 mail-qa0-f51.google.com Received: from [209.85.216.51] ([209.85.216.51:37138] helo=mail-qa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/50-45146-A3D34D45 for ; Thu, 05 Feb 2015 23:04:10 -0500 Received: by mail-qa0-f51.google.com with SMTP id f12so9098145qad.10 for ; Thu, 05 Feb 2015 20:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TB3p0Kff2hO3x9i3HUeZC1lffMjO7l7ACm9ggUMn2x4=; b=OqYCzVONfa71UPfyepRiSnMF7WdT7owvcMfChBN0iXLprwI5o4b2hTN0azVXXihyo/ mDkR3++MYMPHJKdM2PwLQCOynM7A+b6Hz+dmVrrHabbvwWSvEqsBngBzMCXjRk/qMmm6 ZeYhvCjgcr/4GBHYL79DVevZA4GIWnu5RUg/YtJznwCpTwFLLRC6xgO3WPQvBuraTfm1 70CAuFWBumFQMoG6GNeeHFXOXGeIlwh9/HK2y1eZyg60S6zq2SHIqVLbHoqp5ZS1wwY7 /4jAvVC5ihk4WQbxzAhS62ds3zjj4VuCYXyjuFXJckmJUX6MoZBpZGY3kECykCYfwHkc 857A== MIME-Version: 1.0 X-Received: by 10.224.28.198 with SMTP id n6mr3940227qac.15.1423195447685; Thu, 05 Feb 2015 20:04:07 -0800 (PST) Received: by 10.96.3.168 with HTTP; Thu, 5 Feb 2015 20:04:07 -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 11:04:07 +0700 Message-ID: To: Dmitry Stogov Cc: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , Yasuo Ohgaki , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Design by Contract From: pierre.php@gmail.com (Pierre Joye) 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.