MultiHttpClient: Replace PHP version check with defined()

Bug: T285287
Change-Id: I3dfef3f0a13bc8a5ec54912976f23c0c497149a7
This commit is contained in:
Reedy 2021-06-23 01:47:59 +01:00
parent 0bac9e78f4
commit b1b6afd53f

View file

@ -477,7 +477,7 @@ class MultiHttpClient implements LoggerAwareInterface {
* @return string
*/
private function getCurlTime( $ch, $oldOption, $newConstName ): string {
if ( version_compare( PHP_VERSION, '7.3.0', '>=' ) ) {
if ( defined( $newConstName ) ) {
return sprintf( "%.6f", curl_getinfo( $ch, constant( $newConstName ) ) / 1e6 );
} else {
return (string)curl_getinfo( $ch, $oldOption );