Skip to content

Commit 24432b3

Browse files
committed
Use PHP_VERSION_ID to check the minimum required version
This is a micro-optimisation, but it avoids the overhead of two function calls to determine whether the minimum required version of PHP is present. I have also removed the conditional around the a call to gc_collect_cycles within the tests since it checks for version 5.3+, and the minimum version required to run Magento 2 should already satisfy that condition.
1 parent afd8827 commit 24432b3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

app/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
umask(0);
1313

1414
/* PHP version validation */
15-
if (version_compare(phpversion(), '5.5.0', '<') === true) {
15+
if (PHP_VERSION_ID < 50500) {
1616
if (PHP_SAPI == 'cli') {
1717
echo 'Magento supports PHP 5.5.0 or later. ' .
1818
'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ public static function setUpBeforeClass()
115115
public static function tearDownAfterClass()
116116
{
117117
//clear garbage in memory
118-
if (version_compare(PHP_VERSION, '5.3', '>=')) {
119-
gc_collect_cycles();
120-
}
118+
gc_collect_cycles();
121119

122120
$fixtureNamespace = self::_getFixtureNamespace();
123121
if (isset(self::$_classLevelFixtures[$fixtureNamespace])

0 commit comments

Comments
 (0)