PHP Parser

Parse PHP code with JavaScript

Installation

This library is distributed with npm :
npm install php-parser –save

Demo

<?php
/**
* Some namespace & file description
*/
namespace foo {
function bar($a, $b) {
return $a + $b;
}
// will print : 5
echo bar(2, 3);
}