X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fbenchmarks%2Fbench_Wikimedia_base_convert.php;h=86bcc8a3ac89b850668fc32e96c82d05e5a83e83;hb=ffba23d177d5eee876bdc59cdf1b945281b18041;hp=439947dad9f4567248584cf91054bc442cfeda8a;hpb=9a3a412f86ba2568bdf85f9c5def51bdb422032d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/benchmarks/bench_Wikimedia_base_convert.php b/maintenance/benchmarks/bench_Wikimedia_base_convert.php index 439947dad9..86bcc8a3ac 100644 --- a/maintenance/benchmarks/bench_Wikimedia_base_convert.php +++ b/maintenance/benchmarks/bench_Wikimedia_base_convert.php @@ -46,27 +46,25 @@ class BenchWikimediaBaseConvert extends Benchmarker { $length = $this->getOption( "length", 128 ); $number = self::makeRandomNumber( $inbase, $length ); - $this->bench( array( - array( + $this->bench( [ + [ 'function' => 'Wikimedia\base_convert', - 'args' => array( $number, $inbase, $outbase, 0, true, 'php' ) - ), - array( + 'args' => [ $number, $inbase, $outbase, 0, true, 'php' ] + ], + [ 'function' => 'Wikimedia\base_convert', - 'args' => array( $number, $inbase, $outbase, 0, true, 'bcmath' ) - ), - array( + 'args' => [ $number, $inbase, $outbase, 0, true, 'bcmath' ] + ], + [ 'function' => 'Wikimedia\base_convert', - 'args' => array( $number, $inbase, $outbase, 0, true, 'gmp' ) - ), - ) ); - - $this->output( $this->getFormattedResults() ); + 'args' => [ $number, $inbase, $outbase, 0, true, 'gmp' ] + ], + ] ); } protected static function makeRandomNumber( $base, $length ) { - $baseChars = "0123456789abcdefghijklmnopqrstuvwxyz"; - $res = ""; + $baseChars = '0123456789abcdefghijklmnopqrstuvwxyz'; + $res = ''; for ( $i = 0; $i < $length; $i++ ) { $res .= $baseChars[mt_rand( 0, $base - 1 )]; }