1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00
PHP-Parser/test.php

23 lines
521 B
PHP

<?php
function __autoload($class) {
is_file($file = './lib/' . strtr($class, '_', '/') . '.php') && require_once $file;
}
echo '<pre>';
$parser = new Parser;
$prettyPrinter = new PrettyPrinter_Zend;
$code = $prettyPrinter->pStmts(
$parser->parse(
new Lexer(file_get_contents(
'../symfonySandbox\src\vendor\symfony\src\Symfony\Components\Console\Input\InputDefinition.php'
)),
function ($msg) {
echo $msg;
}
)
);
echo htmlspecialchars($code);