yydebug = false; $prettyPrinter = new PrettyPrinter_Zend; echo ' '; $GST = microtime(true); foreach (new RecursiveIteratorIterator( new RecursiveDirectoryIterator($DIR), RecursiveIteratorIterator::LEAVES_ONLY) as $file) { if ('.php' !== substr($file, -4)) { continue; } echo ' '; set_time_limit(5); $errMsg = ''; $startTime = microtime(true); $stmts = $parser->yyparse( new Lexer(file_get_contents($file)), function($msg) use (&$errMsg) { $errMsg = $msg; } ); $time = microtime(true) - $startTime; if (false !== $stmts) { $code = 'pStmts($stmts); $ppStmts = $parser->yyparse( new Lexer($code), function($msg) use (&$errMsg) { $errMsg = $msg; } ); if (false !== $ppStmts) { if ($stmts == $ppStmts) { echo ' '; } else { echo ' '; } } else { echo ' '; } } else { echo ' '; } flush(); } echo '
File Parse Time PrettyPrint Same
' . $file . 'PASS ' . $time . 's PASS PASS
PASS ' . $time . 's PASS FAIL
PASS ' . $time . 's FAIL
FAIL ' . $time . 's
' . $errMsg . '
'; echo 'Total time: ', microtime(true) - $GST;