Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59539 invoked from network); 4 Feb 2014 21:47:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2014 21:47:09 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.240 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.240 imap2-1.ox.registrar-servers.com Received: from [198.187.29.240] ([198.187.29.240:33859] helo=imap2-1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/26-13782-BDF51F25 for ; Tue, 04 Feb 2014 16:47:08 -0500 Received: from [192.168.0.200] (unknown [176.25.177.94]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 659DA5A005E; Tue, 4 Feb 2014 16:47:03 -0500 (EST) Message-ID: <52F15FD6.7060901@ajf.me> Date: Tue, 04 Feb 2014 21:47:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Yasuo Ohgaki CC: Sebastian Krebs , Joe Watkins , PHP internals References: <52EE2B66.4040005@pthreads.org> <52F157BE.3020804@ajf.me> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RE: RFC: expectations/assertions From: ajf@ajf.me (Andrea Faulds) On 04/02/14 21:30, Yasuo Ohgaki wrote: > eval() works. > > php > assert(eval('FALSE;')); > > Warning: assert(): Assertion failed in php shell code on line 1 > php > assert(eval('return FALSE;')); > > Warning: assert(): Assertion failed in php shell code on line 1 > php > > > However, it does not solve inconsistency. PHP code has to be string. > Writing PHP code as string is not fun thing to do ;) That's not what I meant. At present, you do: assert($string); And that string is evaluated. A closure would be faster. Though this is for debugging code, so I'm not sure it matters (though I, unlike some people, might like to use assertions in production code to make sure things fail early, fail often). -- Andrea Faulds http://ajf.me/