Re: Declare minimum PHP version required?
| From: | Rowan Collins | Date: | Tue, 04 Feb 2014 20:24:06 +0000 |
| Subject: | Re: Declare minimum PHP version required? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72208@lists.php.net to get a copy of this message | ||
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]