Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88138 invoked from network); 4 Feb 2014 13:11:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2014 13:11:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.176 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.216.176 mail-qc0-f176.google.com Received: from [209.85.216.176] ([209.85.216.176:52864] helo=mail-qc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/F0-17725-017E0F25 for ; Tue, 04 Feb 2014 08:11:45 -0500 Received: by mail-qc0-f176.google.com with SMTP id e16so13492119qcx.35 for ; Tue, 04 Feb 2014 05:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=V1sprcR6P/BvPuwzZ1DI86eGjK2abWs4v6rWFJ0jnvo=; b=acrdGWX/l5vu4ZVQwp0kPtJPl+n9hIc0N0QyzXezvFl9wzC5VRZg3UUkb4zwyU1BHm mZuIbwjcjM1jFacX3M1qR1dkS2fxUkXqsG9oYgVodunel8OK4mSJf8TTkfXg1ukNkXCD 8n3a5uRXqV7HzevHQdrwj+ed7ulUBi49wwpGg9F7VrJ0y6+0J2IS436F9wtF7wxShrzy lflnR53grblQ8YSUZuUPI/yaRaV3eoyf5yZ5Jmf9CgMaY10x0xhlzz921VrFG7I4yyPq bWrjH861em0oZ1KOFvZF/LN2Ot5PxxGaUyZgZPG3MgSS8bPZHmXNNo58tMaiU91b7Mpy nyeA== X-Received: by 10.140.42.180 with SMTP id c49mr62679484qga.24.1391519501677; Tue, 04 Feb 2014 05:11:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.87.151 with HTTP; Tue, 4 Feb 2014 05:11:00 -0800 (PST) In-Reply-To: References: <52EE2B66.4040005@pthreads.org> Date: Tue, 4 Feb 2014 14:11:00 +0100 Message-ID: To: Yasuo Ohgaki Cc: Joe Watkins , PHP internals Content-Type: multipart/alternative; boundary=001a113aaaf298798404f194617c Subject: Re: [PHP-DEV] RE: RFC: expectations/assertions From: krebs.seb@gmail.com (Sebastian Krebs) --001a113aaaf298798404f194617c Content-Type: text/plain; charset=ISO-8859-1 2014-02-04 Yasuo Ohgaki : > Hi Joe, > > On Sun, Feb 2, 2014 at 8:26 PM, Joe Watkins wrote: > > > https://wiki.php.net/rfc/expectations > > > > Current assert() may call functions > > php > assert(version_compare(PHP_VERSION, '4', '<')); > Note, that not assert() calls the function, but you. You already call "version_compare()" and pass the return value to "assert()". While this works it is not really recommended, because it is executed, even if you disable assertions. Additionally the assertion message after failed assertions is not really useful php > assert('version_compare(PHP_VERSION, "4", "<")'); > > Warning: assert(): Assertion failed in php shell code on line 1 > > but it seem not closure like this > > php > assert(function() {return 2>1;}); > php > assert(function() {return 2<1;}); > assert('2>1'); works > > Is it possible write closure like this? > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > -- github.com/KingCrunch --001a113aaaf298798404f194617c--