class BenchIfSwitch extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark if elseif... versus switch case.";
+ $this->addDescription( 'Benchmark if elseif... versus switch case.' );
}
public function execute() {
- $this->bench( array(
- array( 'function' => array( $this, 'doElseIf' ) ),
- array( 'function' => array( $this, 'doSwitch' ) ),
- ) );
+ $this->bench( [
+ [ 'function' => [ $this, 'doElseIf' ] ],
+ [ 'function' => [ $this, 'doSwitch' ] ],
+ ] );
print $this->getFormattedResults();
}