Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72208 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36088 invoked from network); 4 Feb 2014 20:24:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2014 20:24:18 -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.52 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:52850] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/22-13782-F6C41F25 for ; Tue, 04 Feb 2014 15:24:16 -0500 Received: by mail-wg0-f52.google.com with SMTP id b13so13461325wgh.19 for ; Tue, 04 Feb 2014 12:24:13 -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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=/o6JdgitWclvUULls3mXlZVkerfhy4tEXtyBcmy8Uek=; b=PtIQxVxWCSQHvqpoocCLLw30NIuM/6GbnLTjQD4gFezKoNjQiXUQZyOfZOc+WyYD+f JBIgUOBMpyzp+nHyhhFMb8xBFqq0K4K/9M0FgyRBeBsEre4DjPSLpjxuyhAnj1U9IPgL Ht+JC8Bbpsgn49gpfbBzCdAy6Uurxx8sJ98YqdGozYp3yyVnRJBv8QSO13+TuoGphUVz 2IgpzF1HFa/dQhLZx6mQAgO+75SOFytIHfhMnL3mYdg+u+Phq9gK1RIeGeLlOSA7j6Vm 5tnjSD+LGfhPQHbmts1AyI5mBCZpbrC9BGVbpHj0xMDGbhmxeFrvH7pdgQ7uOK6YjQuD HnBQ== X-Received: by 10.194.250.34 with SMTP id yz2mr29713695wjc.18.1391545452921; Tue, 04 Feb 2014 12:24:12 -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 u6sm38887705wif.6.2014.02.04.12.24.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 12:24:12 -0800 (PST) Message-ID: <52F14C66.3030806@gmail.com> Date: Tue, 04 Feb 2014 20:24:06 +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: internals@lists.php.net References: <52EF4BF8.60005@sugarcrm.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 09:08, Yasuo Ohgaki wrote: > Similar thing could be achieved with new assert() w/o any overheads. > > https://wiki.php.net/rfc/expectations > > assert('version_compare(PHP_VERSION, "5.5.0", ">=")', 'You need PHP 5.5.0 > or later'); I'm confused, isn't this exactly how assert() already works? What needs to change, for this example in particular? Here it is running on several versions, giving a Warning by default: http://3v4l.org/TrBJm And here it is without the second parameter, which in itself requires PHP 5.3: http://3v4l.org/mcQI6 It's slightly confusing that assertions issue a Warning even with ASSERT_BAIL turned on, but with that turned on (which can be at the ini level) you can see that it aborts the script as desired: http://3v4l.org/QZLog Regards, -- Rowan Collins [IMSoP]