Merge "Add support for PHP7 random_bytes in favor of mcrypt_create_iv"
[lhc/web/wiklou.git] / maintenance / benchmarks / bench_utf8_title_check.php
index 62bb0fa..b2f7e96 100644 (file)
 require_once __DIR__ . '/Benchmarker.php';
 
 /**
- * This little benchmark executes the regexp used in Language->checkTitleEncoding()
- * and compares its execution time against that of mb_check_encoding, if available.
+ * This little benchmark executes the regexp formerly used in Language->checkTitleEncoding()
+ * and compares its execution time against that of mb_check_encoding.
  *
  * @ingroup Benchmark
  */
 class BenchUtf8TitleCheck extends Benchmarker {
-       private $canRun;
-
        private $data;
 
        public function __construct() {
@@ -43,7 +41,7 @@ class BenchUtf8TitleCheck extends Benchmarker {
                        "United States of America", // 7bit ASCII
                        "S%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e",
                        "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn",
-                       // This comes from bug 36839
+                       // This comes from T38839
                        "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn%7C"
                        . "Catherine%20Willows%7CDavid%20Hodges%7CDavid%20Phillips%7CGil%20Grissom%7CGreg%20Sanders%7CHodges%7C"
                        . "Internet%20Movie%20Database%7CJim%20Brass%7CLady%20Heather%7C"
@@ -61,20 +59,11 @@ class BenchUtf8TitleCheck extends Benchmarker {
                ];
                // @codingStandardsIgnoreEnd
 
-               $this->canRun = function_exists( 'mb_check_encoding' );
-
-               if ( $this->canRun ) {
-                       $this->addDescription( "Benchmark for using a regexp vs. mb_check_encoding " .
-                               "to check for UTF-8 encoding." );
-               } else {
-                       $this->addDescription( 'CANNOT RUN benchmark using mb_check_encoding: function not available.' );
-               }
+               $this->addDescription( "Benchmark for using a regexp vs. mb_check_encoding " .
+                       "to check for UTF-8 encoding." );
        }
 
        public function execute() {
-               if ( !$this->canRun ) {
-                       return;
-               }
                $benchmarks = [];
                foreach ( $this->data as $val ) {
                        $benchmarks[] = [