Permalink
Browse files

Make old testrunner PHP 5.2 compatible

  • Loading branch information...
nikic committed Jan 15, 2012
1 parent cf3117d commit 584f6b0ab33a2dbd64768031eab737a25a5e007c
Showing with 5 additions and 5 deletions.
  1. +5 −5 test_old/run.php
View
@@ -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 {
@@ -44,7 +44,7 @@
new RecursiveDirectoryIterator($DIR),
RecursiveIteratorIterator::LEAVES_ONLY)
as $file) {
- if (!$FILTER_FUNC($file)) {
+ if (!filter_func($file)) {
continue;
}
@@ -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);
@@ -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);

0 comments on commit 584f6b0

Please sign in to comment.