From a37e25c3e50562b011857073f1bdf579dc739551 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Thu, 3 Sep 2015 13:31:39 -0700 Subject: [PATCH] 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 --- includes/libs/ReplacementArray.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ); } -- 2.20.1