From: Ori Livneh Date: Thu, 3 Sep 2015 20:31:39 +0000 (-0700) Subject: Only use FastStringSearch on PHP <5.5 X-Git-Tag: 1.31.0-rc.0~10152^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=a37e25c3e50562b011857073f1bdf579dc739551;p=lhc%2Fweb%2Fwiklou.git Only use FastStringSearch on PHP <5.5 The native implementation of strtr( $str, $replace_pairs ) matches the performance of FastStringSearch since http://bugs.php.net/63893 has been resolved. HHVM's implementation does too, since PR facebook/hhvm#5471. Change-Id: I20374d37bbb9958188a0487abc5b50f08ce40840 --- diff --git a/includes/libs/ReplacementArray.php b/includes/libs/ReplacementArray.php index 185914ceb0..b6faa3786d 100644 --- a/includes/libs/ReplacementArray.php +++ b/includes/libs/ReplacementArray.php @@ -111,7 +111,10 @@ class ReplacementArray { * @return string */ public function replace( $subject ) { - if ( function_exists( 'fss_prep_replace' ) ) { + if ( + function_exists( 'fss_prep_replace' ) && + version_compare( PHP_VERSION, '5.5.0' ) < 0 + ) { if ( $this->fss === false ) { $this->fss = fss_prep_replace( $this->data ); }