INSTLATION install PHP7 install ast extension USAGE ast.php's output is JSON that represents AST. remove_lineno.php filters out lineno and doccomment from AST. cat /your/file.php | php ./bin/ast.php | php ./bin/remove_lineno.php