/usr/share/php/kohana3.1/modules/codebench/classes/bench/explodelimit.php is in libkohana3.1-mod-codebench-php 3.1.5-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <?php defined('SYSPATH') OR die('No direct script access.');
/**
* @package Kohana/Codebench
* @category Tests
* @author Geert De Deckere <geert@idoe.be>
*/
class Bench_ExplodeLimit extends Codebench {
public $description =
'Having a look at the effect of adding a limit to the <a href="http://php.net/explode">explode</a> function.<br />
http://stackoverflow.com/questions/1308149/how-to-get-a-part-of-url-between-4th-and-5th-slashes';
public $loops = 10000;
public $subjects = array
(
'http://example.com/articles/123a/view',
'http://example.com/articles/123a/view/x/x/x/x/x',
'http://example.com/articles/123a/view/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x',
);
public function bench_explode_without_limit($subject)
{
$parts = explode('/', $subject);
return $parts[4];
}
public function bench_explode_with_limit($subject)
{
$parts = explode('/', $subject, 6);
return $parts[4];
}
}
|