Jphp is a compiler similar to javac that compiles PHP source code into a JVM bytecode compiler. Then it was implemented to let the PHP program run on the Java Virtual machine. It supports many of the php5.3+ features. Jphp is similar to JRuby and Jython. Support: JDK 1.6+ (OpenJDK, Oracle). Goal Jphp is not a replacement for Zend PHP engine or Facebook HHVM. It does not want to implement the Zend runtime (e.g. Curl, Prce, etc.). This entry is for:
- The ability to make useful Java objects in PHP
- Improve performance with JIT and JVM
- Use a better runtime library instead of Zend PHP's Ugly Runtime library
- Let PHP not only be used to develop Web applications
- Also:unicode for strings and threads
Characteristics
- JIT (2x-10x faster PHP 5.4)
- Optimizer (constant expressions, inline functions, etc.)
- Using Java libraries and classes in PHP code.
- Unicode for Strings (UTF-16, like in Java)
- threading, Sockets
- Environment architecture (like sandboxes objects in Runkit zend extension).
- GUI (based on Swing, improved-more flexible layouts)
- Embedded cache system for classes and functions
- Optional hot reloading for classes and functions
Features of language support
(without Zend Runtime libraries)
- PHP 5.2+ fully support (with OOP)
- Closures (PHP 5.3), auto-binding in
$this Closures (PHP 5.4)
- Namespaces fully support (PHP 5.3)
- SPL autoloading for classes (PHP 5.3)
- Iterators, Arrayaccess, Serializable
- Type hinting for classes, arrays, callable (PHP 5.4)
- Array short Syntax (PHP 5.4)
- Ternary short cut "?:", Nowdoc,
__callStatic , __invoke (PHP 5.3)
- Late static binding (PHP 5.3)
- GC for cyclic references (PHP 5.3)
Class::{expr}(), (new Foo)->bar() (PHP 5.4)
- Try finally (PHP 5.5)
- Array and string literal dereferencing (PHP 5.5)
__debugInfoFor Var_dump (PHP 5.6)
- Function Array dereferencing has been added, e.g.
foo()[0] (PHP 5.4)
- Constants can be declared outside a class using the const keyword. (PHP 5.3)
- Dynamic access to static methods (PHP 5.3)
- Exceptions can nested (PHP 5.3)
::classSystem constant (PHP 5.5)
What does it not support?
- Traits (PHP 5.4)
- Generators (PHP 5.5)
- Goto (PHP 5.3)
- List () in foreach (PHP 5.5)
- Binary number format, e.g. 0b001001101 (PHP 5.4)
Project home:http://www.open-open.com/lib/view/home/1395628572618
|