Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72216 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53832 invoked from network); 4 Feb 2014 21:28:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2014 21:28:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wg0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:65223] helo=mail-wg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/25-13782-C6B51F25 for ; Tue, 04 Feb 2014 16:28:13 -0500 Received: by mail-wg0-f44.google.com with SMTP id l18so13262125wgh.23 for ; Tue, 04 Feb 2014 13:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=C5XbkJem9qcJDZkRFjDnHm0xrzPLKUaIte1mdJwaYE4=; b=WVJGGXPzPEh60sJUR0Ac6v0ldcdKlIRzgh1cwCWVdJFZJ7Lz1YSTCcli6ADld1hRIn bs51y1YqHcA+DdVrbBuN2bH1isbNO6wYPiYEf9oJvH4z2xVsfyIX4u9+HrPXu0JTYBnU mlYS4o480lXQclISzCA0jM6tt64B3Xr5lBDh6uvQCxlLPGA+TKKmW+TgfuXawQvpXzkh zsNTZMRbLlOqu88YfWMbwI2mfwcnMVr0sgI4O1z9cRWuIqYxMhomNhyDQj5LSzWOdIAU HR4UFIw6VnFs2qmZQslStgh4GwvhZABV7JKcyKPrbiQGt9eDF/4nSuZwK9nhy3dREMgE SmxA== X-Received: by 10.180.189.169 with SMTP id gj9mr14423274wic.17.1391549288826; Tue, 04 Feb 2014 13:28:08 -0800 (PST) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginm.net. [81.101.201.26]) by mx.google.com with ESMTPSA id f1sm8845501wik.1.2014.02.04.13.28.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 13:28:08 -0800 (PST) Message-ID: <52F15B62.1070006@gmail.com> Date: Tue, 04 Feb 2014 21:28:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Ferenc Kovacs CC: PHP Internals References: <52EF4BF8.60005@sugarcrm.com> <52F14C66.3030806@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Declare minimum PHP version required? From: rowan.collins@gmail.com (Rowan Collins) 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? -- Rowan Collins [IMSoP]