PHP code example of mrsuh / php-ast
1. Go to this page and download the library: Download mrsuh/php-ast library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mrsuh / php-ast example snippets
rsuh\PhpAst\Parser;
use Mrsuh\PhpAst\Printer;
$code = <<<'CODE'
namespace App;
class Test
{
public function test($foo)
{
var_dump($foo);
}
}
CODE;
$node = Parser::parse($code);
Printer::print($node);
bash
composer
bash
git clone --recurse-submodules [email protected]:mrsuh/php-ast.git && cd php-ast
make php-src
make
bash
make debug
gdb php
run bin/test.php
bash
docker build -t php-ast .
docker run --rm -v $PWD:/code -it php-ast bash
make
php bin/test.php