3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Lavoiesl\PhpBenchmark; class Profiler { private $start_memory = 0; private $max_memory = 0; private $start_time = null; private $end_time = null; public function start() { $this->start_memory = $this->max_memory = memory_get_usage(true); $this->start_time = microtime(true); register_tick_function( array( $this, "tick" ) ); } public function tick() { $this->max_memory = max($this->max_memory, memory_get_usage(true)); } public function stop() { $this->tick(); $this->end_time = microtime(true); unregister_tick_function( array( $this, "tick" ) ); } function getMemoryUsage() { return $this->max_memory - $this->start_memory; } function getTime() { return $this->end_time - $this->start_time; } } abstract class AbstractTest { /** * @var string */ private $name; private $profiler; public function __construct($name) { $this->name = $name; $this->profiler = new Profiler; } public function getName() { return $this->name; } public function run($n = 1) { $this->prepare(); gc_collect_cycles(); // clear memory before start $this->profiler->start(); for ($i=0; $i < $n; $i++) { // Store the result so it appears in memory profiling $result = $this->execute(); unset($result); } $this->profiler->stop(); $results = array( 'time' => $this->profiler->getTime(), 'memory' => $this->profiler->getMemoryUsage(), 'n' => $n, ); $this->cleanup(); return $results; } protected function prepare() { } abstract protected function execute(); protected function cleanup() { } public function guessCount($max_seconds = 1) { $this->run(); // warmup $once = $this->run(); if ($once['time'] >= $max_seconds) { return 1; } else { return round($max_seconds / $once['time']); } } } class SimpleTest extends AbstractTest { /** * @var \Closure */ private $prepare = null; /** * @var \Closure */ private $execute; /** * @var \Closure */ private $cleanup = null; public function __construct($name, \Closure $execute) { parent::__construct($name); $this->execute = $execute; } public function setPrepare(\Closure $prepare) { $this->prepare = $prepare; return $this; } protected function prepare() { if ($prepare = $this->prepare) { $prepare(); } } protected function execute() { return call_user_func($this->execute); } public function setCleanup(\Closure $cleanup) { $this->cleanup = $cleanup; return $this; } protected function cleanup() { if ($cleanup = $this->cleanup) { $cleanup(); } } } class Benchmark { /** * @var array [Test] */ private $tests = array(); private $n = null; private $base_results; public function addTest(AbstractTest $test) { $this->tests[$test->getName()] = $test; } /** * Utility method to create tests on the fly * You may chain the test: * * @param string $name * @param \Closure $closure function to execute * @return SimpleTest */ public function add($name, \Closure $closure) { $test = new SimpleTest($name, $closure); $this->addTest($test); return $test; } /** * Runs an empty test to determine the benchmark overhead and run each test once */ private function warmup() { $warmup = new SimpleTest('warmup', function(){}); $warmup->run(); foreach ($this->tests as $test) { $test->run(); } $this->base_results = $warmup->run($this->n); } public function run($output = true) { $results = array(); if (null === $this->n) { $this->guessCount(2); // aim for around 2 seconds per test } if ($output) { echo "Running tests {$this->n} times.\n"; } $this->warmup(); $i = 0; foreach ($this->tests as $name => $test) { if ($output) { echo "Testing ".++$i."/".count($this->tests)." : $name\r"; } $results[$name] = $test->run($this->n); } if ($output) { echo "\n\n"; self::outputTable(self::formatResults($results)); } return $results; } public function setCount($n) { $this->n = $n; } /** * Average the guessCount of each test, determining the best n * * @param float $max_seconds * @return int */ public function guessCount($max_seconds) { if (!$this->tests) { throw new \RuntimeException('No test in Benchmark.'); } $n = INF; foreach ($this->tests as $test) { $n = min($n, $test->guessCount($max_seconds)); } return $this->n = Util::round($n); } /** * Output results in columns, padding right if values are string, left if numeric * * @param array $lines array(array('Name' => 'Value')); * @param integer $padding space between columns */ public static function outputTable(array $lines, $padding = 3) { if (!$lines) { return; } $pad = function ($string, $width) use ($padding) { if ($width > 0) { return str_pad($string, $width, " ") . str_repeat(' ' , $padding); } else { return str_pad($string, -$width, " ", STR_PAD_LEFT) . str_repeat(' ' , $padding); } }; // init width with keys' length $cols = array_combine(array_keys($lines[0]), array_map('strlen', array_keys($lines[0]))); foreach ($cols as $col => $width) { foreach ($lines as $line) { $width = max($width, strlen($line[$col])); } // pad left if numeric if (preg_match('/^[0-9]/', $line[$col])) { $width = -$width; } echo $pad($col, $width); $cols[$col] = $width; } echo "\n"; foreach ($lines as $line) { foreach ($cols as $col => $width) { echo $pad($line[$col], $width); } echo "\n"; } } /** * Format the results, rounding numbers, showing difference percentages * and removing a flat time based on the benchmark overhead * * @param array $results array($name => array('time' => 1.0)) * @return array array(array('Test' => $name, 'Time' => '1000 ms', 'Perc' => '100 %')) */ public function formatResults(array $results) { uasort($results, function($a, $b) { if ($a['time'] == $b['time']) return 0; else return ($a['time'] < $b['time']) ? -1 : 1; }); $min_time = INF; $min_memory = INF; foreach ($results as $name => $result) { $time = $result['time']; $time -= $this->base_results['time']; // Substract base_time $time *= 1000; // Convert to ms $time = round($time); $time = max(1, $time); // min 1 ms $min_time = min($min_time, $time); $results[$name]['time'] = $time; $min_memory = min($min_memory, $results[$name]['memory']); } $output = array(); foreach ($results as $name => $result) { $output[] = array( 'Test' => $name, 'Time' => $result['time'] . ' ms', 'Time (%)' => Util::relativePerc($min_time, $result['time']), 'Memory' => Util::convertToSI($result['memory']), 'Memory (%)' => Util::relativePerc($min_memory, $result['memory']), ); } return $output; } } class Util { public static function round($number, $significant = 0) { $order = floor(log($number) / log(10)); return round($number / pow(10, $order), $significant) * pow(10, $order); } /** * Converts 1024 to 1K, etc. * * @param double $number i.e.: 1280 * @param integer $precision i.e.: 1.25 for precision = 2 * @param string $unit suffix of the unit, may be empty * @param integer $factor change base to 1000 or 1024 * @return string i.e.: 1.25 kB */ public static function convertToSI($number, $precision = 2, $unit = 'B', $factor = 1024) { static $sizes = array( '-3' => 'n', '-2' => 'ยต', '-1' => 'm', '0' => '', '1' => 'k', '2' => 'M', '3' => 'G', '4' => 'T' ); $scale = $number == 0 ? 0 : floor(log($number, $factor)); return round($number / pow($factor, $scale), $precision) . ' ' . $sizes[$scale] . $unit = 'B'; } public static function relativePerc($min, $value) { if ($min == 0 || $min == $value) { return ''; } else { return round(($value - $min) / $min * 100) . ' %'; } } } $benchmark = new Benchmark; function multiexplode ($delimiters,$string) { $ready = str_replace($delimiters, $delimiters[0], $string); $launch = explode($delimiters[0], $ready); return $launch; } function homemadeexplode($splitter, $str) { $return = []; if (is_array($splitter) == true) { foreach ($splitter as $sp) { $str = homemadeexplode($sp, $str); } $return = $str; } else { if (is_array($str) == true) { foreach ($str as $st) { $tmp = explode($splitter, $st); $return = array_merge($return, $tmp); } } else { $return = explode($splitter, $str); } } return $return; } $text = "here is a sample: this text, and this will be exploded. this also | this one too :)"; $benchmark->add('multiexplode', function() use($text) { return multiexplode( [",",".","|",":"], $text); }); $benchmark->add('homemadeExplode', function() use($text) { return homemadeexplode([",",".","|",":"], $text); }); $benchmark->add('preg_split', function() use($text) { return preg_split( '/[,.|:]/', $text); }); $benchmark->add('mb_split', function() use($text) { return mb_split( '[,.|:]', $text); }); $benchmark->setCount(50000); $benchmark->run();
Output for 7.3.0
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 29 ms 0 B multiexplode 58 ms 100 % 0 B mb_split 138 ms 376 % 0 B homemadeExplode 201 ms 593 % 0 B
Output for 7.2.13
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 35 ms 0 B multiexplode 56 ms 60 % 0 B mb_split 144 ms 311 % 0 B homemadeExplode 195 ms 457 % 0 B
Output for 7.2.12
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 64 ms 68 % 0 B mb_split 157 ms 313 % 0 B homemadeExplode 213 ms 461 % 0 B
Output for 7.2.11
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 59 ms 59 % 0 B mb_split 192 ms 419 % 0 B homemadeExplode 206 ms 457 % 0 B
Output for 7.2.10
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 33 ms 0 B multiexplode 59 ms 79 % 0 B mb_split 161 ms 388 % 0 B homemadeExplode 198 ms 500 % 0 B
Output for 7.2.9
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 54 ms 42 % 0 B mb_split 157 ms 313 % 0 B homemadeExplode 195 ms 413 % 0 B
Output for 7.2.8
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 39 ms 0 B multiexplode 53 ms 36 % 0 B mb_split 160 ms 310 % 0 B homemadeExplode 210 ms 438 % 0 B
Output for 7.2.7
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 33 ms 0 B multiexplode 51 ms 55 % 0 B mb_split 150 ms 355 % 0 B homemadeExplode 189 ms 473 % 0 B
Output for 7.2.6
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 35 ms 0 B multiexplode 54 ms 54 % 0 B mb_split 138 ms 294 % 0 B homemadeExplode 215 ms 514 % 0 B
Output for 7.2.5
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 32 ms 0 B multiexplode 73 ms 128 % 0 B mb_split 139 ms 334 % 0 B homemadeExplode 196 ms 513 % 0 B
Output for 7.2.4
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 32 ms 0 B multiexplode 53 ms 66 % 0 B mb_split 133 ms 316 % 0 B homemadeExplode 189 ms 491 % 0 B
Output for 7.2.3
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 39 ms 0 B multiexplode 57 ms 46 % 0 B mb_split 138 ms 254 % 0 B homemadeExplode 203 ms 421 % 0 B
Output for 7.2.2
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 62 ms 68 % 0 B mb_split 145 ms 292 % 0 B homemadeExplode 195 ms 427 % 0 B
Output for 7.2.1
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 50 ms 0 B multiexplode 58 ms 16 % 0 B mb_split 181 ms 262 % 0 B homemadeExplode 189 ms 278 % 0 B
Output for 7.2.0
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 32 ms 0 B multiexplode 60 ms 88 % 0 B mb_split 177 ms 453 % 0 B homemadeExplode 208 ms 550 % 0 B
Output for 7.1.25
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 41 ms 0 B multiexplode 58 ms 41 % 0 B mb_split 90 ms 120 % 0 B homemadeExplode 246 ms 500 % 0 B
Output for 7.1.24
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 39 ms 0 B multiexplode 62 ms 59 % 0 B mb_split 94 ms 141 % 0 B homemadeExplode 243 ms 523 % 0 B
Output for 7.1.23
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 58 ms 45 % 0 B mb_split 90 ms 125 % 0 B homemadeExplode 234 ms 485 % 0 B
Output for 7.1.22
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 77 ms 93 % 0 B mb_split 100 ms 150 % 0 B homemadeExplode 251 ms 528 % 0 B
Output for 7.1.21
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 61 ms 65 % 0 B mb_split 89 ms 141 % 0 B homemadeExplode 257 ms 595 % 0 B
Output for 7.1.20
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 41 ms 0 B multiexplode 57 ms 39 % 0 B mb_split 87 ms 112 % 0 B homemadeExplode 252 ms 515 % 0 B
Output for 7.1.19
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 43 ms 0 B multiexplode 63 ms 47 % 0 B mb_split 104 ms 142 % 0 B homemadeExplode 258 ms 500 % 0 B
Output for 7.1.18
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 32 ms 0 B multiexplode 61 ms 91 % 0 B mb_split 85 ms 166 % 0 B homemadeExplode 247 ms 672 % 0 B
Output for 7.1.17
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 57 ms 43 % 0 B mb_split 88 ms 120 % 0 B homemadeExplode 247 ms 518 % 0 B
Output for 7.1.16
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 59 ms 55 % 0 B mb_split 89 ms 134 % 0 B homemadeExplode 253 ms 566 % 0 B
Output for 7.1.15
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 28 ms 0 B multiexplode 48 ms 71 % 0 B mb_split 76 ms 171 % 0 B homemadeExplode 222 ms 693 % 0 B
Output for 7.1.14
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 42 ms 0 B multiexplode 56 ms 33 % 0 B mb_split 102 ms 143 % 0 B homemadeExplode 239 ms 469 % 0 B
Output for 7.1.13
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 32 ms 0 B multiexplode 60 ms 88 % 0 B mb_split 81 ms 153 % 0 B homemadeExplode 245 ms 666 % 0 B
Output for 7.1.12
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 33 ms 0 B multiexplode 58 ms 76 % 0 B mb_split 87 ms 164 % 0 B homemadeExplode 223 ms 576 % 0 B
Output for 7.1.11
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 35 ms 0 B multiexplode 70 ms 100 % 0 B mb_split 82 ms 134 % 0 B homemadeExplode 251 ms 617 % 0 B
Output for 7.1.10
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 53 ms 43 % 0 B mb_split 87 ms 135 % 0 B homemadeExplode 233 ms 530 % 0 B
Output for 7.1.9
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 64 ms 60 % 0 B mb_split 95 ms 138 % 0 B homemadeExplode 255 ms 538 % 0 B
Output for 7.1.8
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 47 ms 0 B multiexplode 61 ms 30 % 0 B mb_split 93 ms 98 % 0 B homemadeExplode 269 ms 472 % 0 B
Output for 7.1.7
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 59 ms 55 % 0 B mb_split 89 ms 134 % 0 B homemadeExplode 233 ms 513 % 0 B
Output for 7.1.6
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 52 ms 41 % 0 B mb_split 107 ms 189 % 0 B homemadeExplode 236 ms 538 % 0 B
Output for 7.1.5
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 54 ms 42 % 0 B mb_split 97 ms 155 % 0 B homemadeExplode 275 ms 624 % 0 B
Output for 7.1.4
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 33 ms 0 B multiexplode 74 ms 124 % 0 B mb_split 87 ms 164 % 0 B homemadeExplode 229 ms 594 % 0 B
Output for 7.1.3
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 43 ms 0 B multiexplode 56 ms 30 % 0 B mb_split 99 ms 130 % 0 B homemadeExplode 248 ms 477 % 0 B
Output for 7.1.2
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 39 ms 0 B multiexplode 57 ms 46 % 0 B mb_split 116 ms 197 % 0 B homemadeExplode 250 ms 541 % 0 B
Output for 7.1.1
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 58 ms 45 % 0 B mb_split 118 ms 195 % 0 B homemadeExplode 247 ms 518 % 0 B
Output for 7.1.0
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 36 ms 0 B multiexplode 71 ms 97 % 0 B mb_split 91 ms 153 % 0 B homemadeExplode 253 ms 603 % 0 B
Output for 7.0.33
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 41 ms 0 B multiexplode 68 ms 66 % 0 B mb_split 99 ms 141 % 0 B homemadeExplode 258 ms 529 % 0 B
Output for 7.0.26
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 39 ms 0 B multiexplode 48 ms 23 % 0 B mb_split 87 ms 123 % 0 B homemadeExplode 200 ms 413 % 0 B
Output for 7.0.25
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 54 ms 0 B multiexplode 56 ms 4 % 0 B mb_split 97 ms 80 % 0 B homemadeExplode 208 ms 285 % 0 B
Output for 7.0.24
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 53 ms 33 % 0 B mb_split 89 ms 123 % 0 B homemadeExplode 201 ms 403 % 0 B
Output for 7.0.23
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 35 ms 0 B multiexplode 57 ms 63 % 0 B mb_split 78 ms 123 % 0 B homemadeExplode 207 ms 491 % 0 B
Output for 7.0.22
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 39 ms 0 B multiexplode 59 ms 51 % 0 B mb_split 89 ms 128 % 0 B homemadeExplode 212 ms 444 % 0 B
Output for 7.0.21
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 42 ms 0 B multiexplode 57 ms 36 % 0 B mb_split 81 ms 93 % 0 B homemadeExplode 207 ms 393 % 0 B
Output for 7.0.20
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 35 ms 0 B multiexplode 52 ms 49 % 0 B mb_split 85 ms 143 % 0 B homemadeExplode 212 ms 506 % 0 B
Output for 7.0.19
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 41 ms 0 B multiexplode 52 ms 27 % 0 B mb_split 98 ms 139 % 0 B homemadeExplode 227 ms 454 % 0 B
Output for 7.0.18
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 57 ms 43 % 0 B mb_split 94 ms 135 % 0 B homemadeExplode 214 ms 435 % 0 B
Output for 7.0.17
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 55 ms 45 % 0 B mb_split 91 ms 139 % 0 B homemadeExplode 217 ms 471 % 0 B
Output for 7.0.16
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 42 ms 0 B multiexplode 53 ms 26 % 0 B mb_split 89 ms 112 % 0 B homemadeExplode 222 ms 429 % 0 B
Output for 7.0.15
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 33 ms 0 B multiexplode 45 ms 36 % 0 B mb_split 83 ms 152 % 0 B homemadeExplode 208 ms 530 % 0 B
Output for 7.0.14
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 45 ms 0 B multiexplode 58 ms 29 % 0 B mb_split 96 ms 113 % 0 B homemadeExplode 247 ms 449 % 0 B
Output for 7.0.13
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 27 ms 0 B multiexplode 62 ms 130 % 0 B mb_split 80 ms 196 % 0 B homemadeExplode 201 ms 644 % 0 B
Output for 7.0.12
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 40 ms 0 B multiexplode 53 ms 33 % 0 B mb_split 95 ms 138 % 0 B homemadeExplode 212 ms 430 % 0 B
Output for 7.0.11
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 42 ms 0 B multiexplode 73 ms 74 % 0 B mb_split 119 ms 183 % 0 B homemadeExplode 213 ms 407 % 0 B
Output for 7.0.10
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 49 ms 29 % 0 B mb_split 92 ms 142 % 0 B homemadeExplode 225 ms 492 % 0 B
Output for 7.0.9
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 41 ms 0 B multiexplode 52 ms 27 % 0 B mb_split 93 ms 127 % 0 B homemadeExplode 209 ms 410 % 0 B
Output for 7.0.8
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 60 ms 62 % 0 B mb_split 96 ms 159 % 0 B homemadeExplode 222 ms 500 % 0 B
Output for 7.0.7
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 38 ms 0 B multiexplode 74 ms 95 % 0 B mb_split 97 ms 155 % 0 B homemadeExplode 223 ms 487 % 0 B
Output for 7.0.6
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 35 ms 0 B multiexplode 55 ms 57 % 0 B mb_split 91 ms 160 % 0 B homemadeExplode 212 ms 506 % 0 B
Output for 7.0.5
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 66 ms 0 B multiexplode 66 ms 0 B mb_split 94 ms 42 % 0 B homemadeExplode 214 ms 224 % 0 B
Output for 7.0.4
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 42 ms 0 B multiexplode 76 ms 81 % 0 B mb_split 96 ms 129 % 0 B homemadeExplode 318 ms 657 % 0 B
Output for 7.0.3
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 37 ms 0 B multiexplode 50 ms 35 % 0 B mb_split 83 ms 124 % 0 B homemadeExplode 338 ms 814 % 0 B
Output for 7.0.2
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 33 ms 0 B multiexplode 52 ms 58 % 0 B mb_split 83 ms 152 % 0 B homemadeExplode 270 ms 718 % 0 B
Output for 7.0.1
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 50 ms 0 B multiexplode 52 ms 4 % 0 B mb_split 85 ms 70 % 0 B homemadeExplode 225 ms 350 % 0 B
Output for 7.0.0
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) preg_split 30 ms 0 B multiexplode 63 ms 110 % 0 B mb_split 84 ms 180 % 0 B homemadeExplode 241 ms 703 % 0 B
Output for hhvm-3.22.0
Running tests 50000 times. Fatal error: Uncaught Error: Call to undefined function Lavoiesl\PhpBenchmark\register_tick_function() in /in/s6vfi:-1 Stack trace: #0 /in/s6vfi(-1): Lavoiesl\PhpBenchmark\Profiler->start() #1 /in/s6vfi(-1): Lavoiesl\PhpBenchmark\AbstractTest->run() #2 /in/s6vfi(-1): Lavoiesl\PhpBenchmark\Benchmark->warmup() #3 /in/s6vfi(-1): Lavoiesl\PhpBenchmark\Benchmark->run() #4 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Running tests 50000 times. Fatal error: Uncaught Error: Call to undefined function Lavoiesl\PhpBenchmark\register_tick_function() in /in/s6vfi:20 Stack trace: #0 /in/s6vfi(74): Lavoiesl\PhpBenchmark\Profiler->start() #1 /in/s6vfi(216): Lavoiesl\PhpBenchmark\AbstractTest->run() #2 /in/s6vfi(237): Lavoiesl\PhpBenchmark\Benchmark->warmup() #3 /in/s6vfi(459): Lavoiesl\PhpBenchmark\Benchmark->run() #4 {main}
Process exited with code 255.
Output for 5.6.38
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 110 ms 0 B multiexplode 126 ms 15 % 0 B preg_split 225 ms 105 % 0 B homemadeExplode 690 ms 527 % 0 B
Output for 5.6.30
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 121 ms 0 B multiexplode 137 ms 13 % 0 B preg_split 252 ms 108 % 0 B homemadeExplode 667 ms 451 % 0 B
Output for 5.6.29
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) multiexplode 124 ms 0 B mb_split 125 ms 1 % 0 B preg_split 227 ms 83 % 0 B homemadeExplode 705 ms 469 % 0 B
Output for 5.6.28
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 94 ms 0 B multiexplode 163 ms 73 % 0 B preg_split 201 ms 114 % 0 B homemadeExplode 611 ms 550 % 0 B
Output for 5.6.27
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 124 ms 0 B multiexplode 148 ms 19 % 0 B preg_split 251 ms 102 % 0 B homemadeExplode 629 ms 407 % 0 B
Output for 5.6.26
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 100 ms 0 B multiexplode 145 ms 45 % 0 B preg_split 197 ms 97 % 0 B homemadeExplode 613 ms 513 % 0 B
Output for 5.6.25
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 110 ms 0 B multiexplode 125 ms 14 % 0 B preg_split 217 ms 97 % 0 B homemadeExplode 623 ms 466 % 0 B
Output for 5.6.24
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 127 ms 0 B multiexplode 142 ms 12 % 0 B preg_split 230 ms 81 % 0 B homemadeExplode 580 ms 357 % 0 B
Output for 5.6.23
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 121 ms 0 B multiexplode 139 ms 15 % 0 B preg_split 218 ms 80 % 0 B homemadeExplode 677 ms 460 % 0 B
Output for 5.6.22
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 138 ms 0 B multiexplode 139 ms 1 % 0 B preg_split 235 ms 70 % 0 B homemadeExplode 605 ms 338 % 0 B
Output for 5.6.21
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 103 ms 0 B multiexplode 118 ms 15 % 0 B preg_split 400 ms 288 % 0 B homemadeExplode 892 ms 766 % 0 B
Output for 5.6.20
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 129 ms 0 B multiexplode 225 ms 74 % 0 B preg_split 253 ms 96 % 0 B homemadeExplode 793 ms 515 % 0 B
Output for 5.6.19
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 138 ms 0 B multiexplode 177 ms 28 % 0 B preg_split 233 ms 69 % 0 B homemadeExplode 720 ms 422 % 0 B
Output for 5.6.18
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 122 ms 0 B multiexplode 137 ms 12 % 0 B preg_split 252 ms 107 % 0 B homemadeExplode 626 ms 413 % 0 B
Output for 5.6.17
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 132 ms 0 B multiexplode 142 ms 8 % 0 B preg_split 240 ms 82 % 0 B homemadeExplode 760 ms 476 % 0 B
Output for 5.6.16
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 165 ms 0 B preg_split 231 ms 40 % 0 B multiexplode 248 ms 50 % 0 B homemadeExplode 801 ms 385 % 0 B
Output for 5.6.15
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 121 ms 0 B multiexplode 138 ms 14 % 0 B preg_split 224 ms 85 % 0 B homemadeExplode 614 ms 407 % 0 B
Output for 5.6.14
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 142 ms 0 B multiexplode 156 ms 10 % 0 B preg_split 270 ms 90 % 0 B homemadeExplode 631 ms 344 % 0 B
Output for 5.6.13
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 117 ms 0 B multiexplode 133 ms 14 % 0 B preg_split 215 ms 84 % 0 B homemadeExplode 629 ms 438 % 0 B
Output for 5.6.12
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 127 ms 0 B multiexplode 135 ms 6 % 0 B preg_split 220 ms 73 % 0 B homemadeExplode 595 ms 369 % 0 B
Output for 5.6.11
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 117 ms 0 B multiexplode 139 ms 19 % 0 B preg_split 215 ms 84 % 0 B homemadeExplode 734 ms 527 % 0 B
Output for 5.6.10
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 119 ms 0 B multiexplode 129 ms 8 % 0 B preg_split 211 ms 77 % 0 B homemadeExplode 650 ms 446 % 0 B
Output for 5.6.9
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 126 ms 0 B multiexplode 131 ms 4 % 0 B preg_split 217 ms 72 % 0 B homemadeExplode 593 ms 371 % 0 B
Output for 5.6.8
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 96 ms 0 B multiexplode 154 ms 60 % 0 B preg_split 199 ms 107 % 0 B homemadeExplode 613 ms 539 % 0 B
Output for 5.6.7
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 155 ms 0 B preg_split 224 ms 45 % 0 B multiexplode 227 ms 46 % 0 B homemadeExplode 583 ms 276 % 0 B
Output for 5.6.6
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 127 ms 0 B multiexplode 183 ms 44 % 0 B preg_split 219 ms 72 % 0 B homemadeExplode 626 ms 393 % 0 B
Output for 5.6.5
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 129 ms 0 B multiexplode 136 ms 5 % 0 B preg_split 218 ms 69 % 0 B homemadeExplode 581 ms 350 % 0 B
Output for 5.6.4
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 119 ms 0 B multiexplode 179 ms 50 % 0 B preg_split 225 ms 89 % 0 B homemadeExplode 660 ms 455 % 0 B
Output for 5.6.3
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) multiexplode 138 ms 0 B mb_split 139 ms 1 % 0 B preg_split 259 ms 88 % 0 B homemadeExplode 659 ms 378 % 0 B
Output for 5.6.2
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 125 ms 0 B multiexplode 131 ms 5 % 0 B preg_split 228 ms 82 % 0 B homemadeExplode 604 ms 383 % 0 B
Output for 5.6.1
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 132 ms 0 B multiexplode 149 ms 13 % 0 B preg_split 237 ms 80 % 0 B homemadeExplode 708 ms 436 % 0 B
Output for 5.6.0
Running tests 50000 times. Testing 1/4 : multiexplode Testing 2/4 : homemadeExplode Testing 3/4 : preg_split Testing 4/4 : mb_split Test Time Time (%) Memory Memory (%) mb_split 125 ms 0 B multiexplode 191 ms 53 % 0 B preg_split 261 ms 109 % 0 B homemadeExplode 646 ms 417 % 0 B