*/
class Bench_MDDoBaseURL extends Codebench {
public $description =
'Optimization for the doBaseURL()
method of KO7_Kodoc_Markdown
for the KO7 Userguide.';
public $loops = 10000;
public $subjects = [
// Valid matches
'[filesystem](about.filesystem)',
'[filesystem](about.filesystem "Optional title")',
'[same page link](#id)',
'[object oriented](http://wikipedia.org/wiki/Object-Oriented_Programming)',
// Invalid matches
'![this is image syntax](about.filesystem)',
'[filesystem](about.filesystem',
];
public function bench_original($subject)
{
// The original regex contained a bug, which is fixed here for benchmarking purposes.
// At the very start of the regex, (?!!) has been replace by (?