addDescription( 'Benchmark for string replacement methods.' ); } public function execute() { $this->bench( [ 'strtr' => [ $this, 'bench_strtr' ], 'str_replace' => [ $this, 'bench_str_replace' ], ] ); } protected function bench_strtr() { strtr( $this->input, "_", " " ); } protected function bench_str_replace() { str_replace( "_", " ", $this->input ); } } $maintClass = BenchmarkStringReplacement::class; require_once RUN_MAINTENANCE_IF_MAIN;