Skip to content

lihuibin/jphp

 
 

Repository files navigation

JPHP - an implementation of PHP

Join the chat at https://gitter.im/jphp-compiler/jphp (English & Russian chat)

Build Status Download Documentation Status

JPHP is a new implementation for PHP which uses the Java VM. It supports many features of the PHP language (5.6+).

How does it work? JPHP is a compiler like javac, it compiles php sources to JVM bytecode and then can execute the result on the Java VM.

Goals

JPHP is not a replacement for the Zend PHP engine or Facebook HHVM. We don’t plan to implement the zend runtime libraries (e.g. Curl, PRCE, etc.) for JPHP.

Our project started in October 2013. There were a few reasons for that:

  1. Ability to use java libraries in PHP
  2. Upgrading performance via JIT and JVM
  3. Replacing the ugly runtime library of Zend PHP with a better runtime library.
  4. Using the PHP language not only on the web
  5. Also: unicode for strings and threads

Features

  • JIT (~2.5 faster PHP 5.6, ~1.1 faster PHP 7), Optimizer - Performance benchmarks
  • Using java libraries and classes in PHP code.
  • Unicode for strings (UTF-16, like in Java)
  • Threading, Sockets, Environment architecture (like sandbox objects in the 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
  • Ability to use on Android OS

What JPHP does not yet support?

  • Importing namespaced functions (php 5.6)

Documentation

Getting started (Hello World)

http://j-php.net/wiki/Getting-started

Build SNAPSHOT from sources

Use gradle install to build and install the jphp modules and libraries into the mavel local repository. After this, you can use jphp in your projects as a maven dependency.

org.develnext:jphp-core:<version>-SNAPSHOT

About

An alternative to Zend PHP, like JRuby and Jython only for PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 75.4%
  • PHP 24.2%
  • Groovy 0.3%
  • HTML 0.1%
  • C++ 0.0%
  • Shell 0.0%