addDescription( 'Compares the performance of mbstring fallbacks vs. native implementation' ); } public function execute() { $cyrillicText = 'Съешь ещё этих мягких французских булок, да выпей же чаю'; $this->bench( [ [ 'function' => 'mb_substr', 'args' => [ $cyrillicText, 50, 200 ], ], [ 'function' => 'Fallback::mb_substr', 'args' => [ $cyrillicText, 50, 200 ], ], [ 'function' => 'mb_substr', 'args' => [ $this->mDescription, 50, 200 ], ], [ 'function' => 'Fallback::mb_substr', 'args' => [ $this->mDescription, 50, 200 ], ], [ 'function' => 'mb_strlen', 'args' => [ $cyrillicText ], ], [ 'function' => 'Fallback::mb_strlen', 'args' => [ $cyrillicText ], ], [ 'function' => 'mb_strlen', 'args' => [ $this->mDescription ], ], [ 'function' => 'Fallback::mb_strlen', 'args' => [ $this->mDescription ], ], ] ); $this->output( $this->getFormattedResults() ); } } $maintClass = "BenchmarkFallbacks"; require_once RUN_MAINTENANCE_IF_MAIN;