Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1789 invoked from network); 4 Feb 2014 00:34:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2014 00:34:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.28 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.28 out4-smtp.messagingengine.com Received: from [66.111.4.28] ([66.111.4.28:60846] helo=out4-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/91-35654-1A530F25 for ; Mon, 03 Feb 2014 19:34:41 -0500 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 1398D20B35 for ; Mon, 3 Feb 2014 19:34:39 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Mon, 03 Feb 2014 19:34:39 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=xtZjKVyitpcS6I4fAlSRyG 2oWEg=; b=akVeMSSZMszszz+u3NVCnRvJiQ2WZRJG0kqGwz8SIGuHw+WxWtC78o YnbvKpvyh8+4VE21OIvP7t+ggx/kLEpdd1I5egLoZ7ztuCIx1UdU2vwKhUT/x8sG KAyeFc2kePh0rJFPVOFm1WXMr3PUIjz5XT34GagfVa3fFqRtcusB0= X-Sasl-enc: zQZMRFg31uvOTpkNznoVU1xepwG4+XZCmrfEukAwv0jL 1391474078 Received: from Palantirs-MacBook-Pro-2.local (unknown [63.250.249.138]) by mail.messagingengine.com (Postfix) with ESMTPA id D9CCBC007AA for ; Mon, 3 Feb 2014 19:34:38 -0500 (EST) Message-ID: <52F0359E.1060707@garfieldtech.com> Date: Mon, 03 Feb 2014 18:34:38 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <52EF4BF8.60005@sugarcrm.com> <52EF7ADA.8090001@lsces.co.uk> <52EFF13F.4050704@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: larry@garfieldtech.com (Larry Garfield) On 2/3/14 1:57 PM, Yasuo Ohgaki wrote: > Hi Stas, > > On Tue, Feb 4, 2014 at 4:42 AM, Stas Malyshev wrote: > >>> There are many code out there checks if (!extention_loaded(foo')) >> die('You >>> need foo'). This is waste of CPU resources once it is checked. These >>> requirements for scripts may be evaluated at compile time and script >> runs a >>> little faster. >> >> Managing requirements is a job for package manager, like composer, not >> language compiler, IMO. > > > I agree that good package manager should manage requirements. However, once > code is installed, package manager will not check requirements. (Package > manager could be made to execute requirement checks at any time, though) > Therefore, there would be developers embed environmental checks to make > sure not to die with function not found, etc. > > In addition to this, there would be SCL for RHEL7 and there are some tools > like phpenv. Installing PHP does not have to be executing PHP. Even if > there is good package manager, compile time requirement check is nice to > have. It's nice to have and it's not must have, though. > > Regards, I have to agree with Stas and Sara on this one. This is not the job of the language syntax. This is the package manager's job; once the code is installed (not compiled, installed), you shouldn't be changing your version anyway without knowing what you're doing / verifying on a test system anyway. If this were more like Javascript's "use strict", where it affected the parsing rules of that file, that would at least be useful (if potentially mind-bendingly painful for the engine; no I'm not suggesting we do that). But a shortcut for if (version_compare()) die; is not needed, and that would be a dumb way to go about implementing version requirements in the first place. --Larry Garfield