Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81900 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45144 invoked from network); 5 Feb 2015 11:38:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 11:38:24 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:51349] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/53-27691-E2653D45 for ; Thu, 05 Feb 2015 06:38:23 -0500 Received: (qmail 14415 invoked by uid 1009); 5 Feb 2015 12:38:19 +0100 Received: from 209.85.216.50 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/20031. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.216.50):. Processed in 0.26106 secs); 05 Feb 2015 11:38:19 -0000 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.216.50):. Processed in 0.26106 secs Process 14393) Received: from mail-qa0-f50.google.com (gmail@bof.de@209.85.216.50) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 5 Feb 2015 12:38:19 +0100 Received: by mail-qa0-f50.google.com with SMTP id k15so5351114qaq.9 for ; Thu, 05 Feb 2015 03:38:17 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.224.7.3 with SMTP id b3mr6977435qab.71.1423136297724; Thu, 05 Feb 2015 03:38:17 -0800 (PST) Received: by 10.140.104.65 with HTTP; Thu, 5 Feb 2015 03:38:17 -0800 (PST) Received: by 10.140.104.65 with HTTP; Thu, 5 Feb 2015 03:38:17 -0800 (PST) In-Reply-To: References: Date: Thu, 5 Feb 2015 12:38:17 +0100 Message-ID: To: Dmitry Stogov Cc: internals , Yasuo Ohgaki Content-Type: multipart/alternative; boundary=047d7b6245a47e34fc050e55bdb4 Subject: Re: [PHP-DEV] Design by Contract From: php@bof.de (Patrick Schaaf) --047d7b6245a47e34fc050e55bdb4 Content-Type: text/plain; charset=UTF-8 Am 05.02.2015 12:14 schrieb "Dmitry Stogov" : > > For php it may look like the following: > > function foo() > require() > ensure() > { > ... > } > > It would require only one new reserved word "ensure". How would one access the function return value in the output-assert-expression? And what about side effects in these expressions? Could they be suppressed / made into errors somehow? best regards Patrick --047d7b6245a47e34fc050e55bdb4--