Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94962 invoked from network); 5 Feb 2014 01:31:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2014 01:31:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.54 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.54 mail-la0-f54.google.com Received: from [209.85.215.54] ([209.85.215.54:49492] helo=mail-la0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/E1-12415-06491F25 for ; Tue, 04 Feb 2014 20:31:12 -0500 Received: by mail-la0-f54.google.com with SMTP id y1so7036940lam.41 for ; Tue, 04 Feb 2014 17:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=xtNq/q1UmF3N27jz+Q0705xrV3A3XcCYXtH82isLITA=; b=dXWeIzTU8LhYKnAcX2wMXq/f+qDFgko1SdSA1CoZ1EdfN5/fW34y97Ivko81DRdtow j3L8+mB1By4Q36olhOgZNU1P8L3nu9PojoifEFiixOgZIL5h9BfJxiowstRnKW/ttHmA dO3/eoLgMByP8zdkv8XXkRFk5Zabn1Jg8azwqhzp+d05sOIlJ7yY0OFCQAd2GaLPJ0R4 8nPIfWMnCOpmEBDOywzAXfW4CD7mxUvs1qCr1xYckNxhaw3y+Z5SjT0uEIkZYLb7G8am d8PWI9qXPekqV+jdRQpyW5wJPpGDM/op89n5V/LPDnhMwgbFEOKUsYLQj7MmyDPWMIRY Wh7A== X-Received: by 10.152.36.70 with SMTP id o6mr24003950laj.7.1391563868604; Tue, 04 Feb 2014 17:31:08 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Tue, 4 Feb 2014 17:30:27 -0800 (PST) In-Reply-To: References: <52EF4BF8.60005@sugarcrm.com> <52F14C66.3030806@gmail.com> <52F15B62.1070006@gmail.com> Date: Wed, 5 Feb 2014 10:30:27 +0900 X-Google-Sender-Auth: uHoczojz_x23aHCYrupE0FHELLs Message-ID: To: Ferenc Kovacs Cc: Rowan Collins , PHP Internals Content-Type: multipart/alternative; boundary=089e0160b618120e5704f19eb68e Subject: Re: [PHP-DEV] Declare minimum PHP version required? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0160b618120e5704f19eb68e Content-Type: text/plain; charset=UTF-8 Hi all, On Wed, Feb 5, 2014 at 6:43 AM, Ferenc Kovacs wrote: > > On 04/02/2014 21:04, Ferenc Kovacs wrote: > > > >> with the current assert implementation the assert is a function, which > >> eval()-s the expression argument, but it will return early if asserts > are > >> disabled(http://lxr.php.net/xref/PHP_5_5/ext/standard/assert.c#149) > >> with the proposed assert (https://wiki.php.net/rfc/expectations) the > >> assert will be changed into a language construct, which has the > advantage > >> that we can use expressions instead of passing a string for evaluation > >> without additional cost, also executing that is cheaper than a function > >> call, and when the assertions are disabled they will be almost > zero-cost. > >> > >> > > Thanks for that. As posted elsewhere, I think the RFC could make that > > clearer. > > > > So the relevance to this discussion is that you could already do a > version > > check with an assert(), and the proposed version of assert() would be as > > efficient as the proposed declare(); does that sound right? > > > > > I would wait for Yasuo to answer, but that my understanding, yes. Yes. New assert() is as efficient as declare(). I cannot wait to use new assert()! Regards, P.S. I really would like to have 'callable' as the 1st parameter of new assert(). -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0160b618120e5704f19eb68e--