PHPVersionCheck: remove version_compare() existence check
authorMax Semenik <maxsem.wiki@gmail.com>
Fri, 14 Jun 2019 01:36:14 +0000 (18:36 -0700)
committerMaxSem <maxsem.wiki@gmail.com>
Fri, 14 Jun 2019 22:23:49 +0000 (22:23 +0000)
It was added to PHP in 2001.

Change-Id: I3b14d726aa1cefd6b64e4bac39ef489b3c79ac1a

includes/PHPVersionCheck.php

index 2d9216d..b63a84d 100644 (file)
@@ -123,10 +123,7 @@ class PHPVersionCheck {
                $phpInfo = $this->getPHPInfo();
                $minimumVersion = $phpInfo['minSupported'];
                $otherInfo = $this->getPHPInfo( $phpInfo['implementation'] === 'HHVM' ? 'PHP' : 'HHVM' );
-               if (
-                       !function_exists( 'version_compare' )
-                       || version_compare( $phpInfo['version'], $minimumVersion ) < 0
-               ) {
+               if ( version_compare( $phpInfo['version'], $minimumVersion ) < 0 ) {
                        $shortText = "MediaWiki $this->mwVersion requires at least {$phpInfo['implementation']}"
                                . " version $minimumVersion or {$otherInfo['implementation']} version "
                                . "{$otherInfo['minSupported']}, you are using {$phpInfo['implementation']} "