Uniter
Uniter allows you to execute PHP in the browser or in Node.js.
As an on-the-fly recompiling interpreter (or transpiler) it results in the closest possible translation from PHP to native JavaScript code.
Features
-
Environment-agnostic architecture: should run in any modern browser (IE < 9 support coming soon) and Node.js
-
PHP statements, constructs and operators:
if
,else
andelse if
statementswhile
loop supportfor
loop supportforeach
loop supportfunction
statements- Closure
function
expressions switch
statements- Forward
goto
statements - Basic
class
object support using thenew
operator use
statement forclass
,namespace
andfunction
importing and aliasing- Magic
__autoload(...)
function - Ternary operator
- Loose equality
==
and inequality!=
comparison operators
And others... see the
Engine
integration tests for more info.
Can I try it now?
Keeping up to date
- Follow me on Twitter for updates: https://twitter.com/@asmblah
Running the tests
There are two supported ways of running the Mocha test suite:
-
Run the tests in Node.js from the command line:
cd uniter/ npm test
-
Run the tests in a browser by starting a Node.js server:
npm run-script webtest
You should then be able to run the tests by visiting http://127.0.0.1:6700 in a supported web browser.