Skip to content

Commit

Permalink
Make old testrunner PHP 5.2 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 15, 2012
1 parent cf3117d commit 584f6b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test_old/run.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
$DIR = $argv[2];

if ('Symfony' === $TEST_TYPE) {
$FILTER_FUNC = function ($path) {
function filter_func($path) {
return preg_match('~\.php(?:\.cache)?$~', $path) && false === strpos($path, 'skeleton');
};
} elseif ('PHP' === $TEST_TYPE) {
$FILTER_FUNC = function ($path) {
function filter_func($path) {
return preg_match('~\.phpt$~', $path);
};
} else {
Expand All @@ -44,7 +44,7 @@
new RecursiveDirectoryIterator($DIR),
RecursiveIteratorIterator::LEAVES_ONLY)
as $file) {
if (!$FILTER_FUNC($file)) {
if (!filter_func($file)) {
continue;
}

Expand Down Expand Up @@ -87,7 +87,7 @@

try {
$startTime = microtime(true);
$stmts = $parser->parse(new PHPParser_Lexer($code));
$stmts = $parser->parse(new PHPParser_Lexer_Emulative($code));
$parseTime += microtime(true) - $startTime;

$startTime = microtime(true);
Expand All @@ -96,7 +96,7 @@

try {
$startTime = microtime(true);
$ppStmts = $parser->parse(new PHPParser_Lexer($code));
$ppStmts = $parser->parse(new PHPParser_Lexer_Emulative($code));
$reparseTime += microtime(true) - $startTime;

$startTime = microtime(true);
Expand Down

0 comments on commit 584f6b0

Please sign in to comment.