Tuesday, December 18, 2007

phc -- the open source PHP compiler

phc -- the open source PHP compiler
phc is a framework for static analysis of PHP scripts, PHP source to source transformations, and ultimately compiling PHP scripts down to native machine code.
The current release does not yet compile PHP and is therefore not yet useful for end-users. It is however useful for writing tools that operate on PHP scripts, such as refactoring tools, aspect weavers, or obfuscators (see Spinoffs for some other suggestions). See What's in Store to get an idea of what is planned for next releases of phc.
phc provides the programmer with a well-defined representation of PHP scripts (an abstract syntax tree or AST), an API to define analyses and transformations over this representation, and an unparser to output the AST back to PHP syntax. In addition, import and export of XML is supported. See the Demo for a quick idea of what phc can do for you, or the Documentation to get started with phc