An alternative to Zend PHP, like JRuby and Jython only for PHP
Java PHP Other
Permalink
Failed to load latest commit information.
bench Rename String class to Str, fix class loading in concurrent environme… Jun 25, 2015
docs @ 846fb90 Update docs. Apr 3, 2016
gradle/wrapper Update version. Mar 15, 2016
jphp-android Implement loading extensions via Service Loader. Dec 23, 2015
jphp-cli Global upgrade. Apr 13, 2015
jphp-compress-ext Implement package system. Feb 5, 2017
jphp-core Fix bug of __FUNCTION__ and __METHOD__ behaviour in closures. Mar 25, 2017
jphp-debugger Implement loading extensions via Service Loader. Dec 23, 2015
jphp-gen-api Rename gen-docs task to genApi. May 5, 2015
jphp-httpclient-ext Implement package system. Feb 5, 2017
jphp-json-ext Update vendor versions. Mar 12, 2017
jphp-jsoup-ext Update vendor versions. Mar 12, 2017
jphp-mail-ext Update stubs - add package info. Feb 5, 2017
jphp-orientdb-ext PHP RFC: Uniform Variable Syntax. Apr 14, 2016
jphp-pni-ext Add Stream::eachLine() method. Nov 1, 2016
jphp-runtime Fix cycled refrence assignment. Mar 25, 2017
jphp-scripting Small fixes Oct 22, 2014
jphp-sql-ext Implement package system. Feb 5, 2017
jphp-swing-ext Implement package system. Feb 5, 2017
jphp-webserver-ext Update stubs - add package info. Feb 5, 2017
jphp-xml-ext Fix htmlspecialchars(), imrpove xml dom api, add user data for Invoke… Mar 1, 2017
jphp-zend-ext Fix htmlspecialchars(), imrpove xml dom api, add user data for Invoke… Mar 1, 2017
sandbox Upgrade pkg system. Feb 10, 2017
.gitignore Small fixes Oct 22, 2014
.gitmodules Updates Apr 22, 2014
.travis.yml Fix travis bug. Sep 9, 2016
LICENSE Update LICENSE May 12, 2015
README.md Update README.md Aug 30, 2016
build.gradle Merge branch 'v0.9.master' Apr 11, 2016
gradlew Update version. Mar 15, 2016
gradlew.bat Add gradle wrapper Apr 29, 2014
settings.gradle Improve pna ext. Oct 4, 2016

README.md

JPHP - an implementation of PHP

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.

In Production

We develop a new IDE for beginners like Game Maker or Scirra Construct. It's based on JPHP, JavaFX, Java 8, Gradle and allows to create desktop games and apps for Linux, Windows and Mac (maybe Android and other platforms in future). The project name is DevelNext (https://github.com/jphp-compiler/develnext), the current status and version of the project is BETA. The project has not yet been localized in English.

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

  • PHP 5.6+ (some language features from PHP 7).
  • 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 (Swing or JavaFX)
  • Embedded cache system for classes and functions
  • Optional Hot Reloading for classes and functions
  • Ability to use on Android OS (not yet)

What JPHP supports from PHP 7?

  • Context Sensitive Lexer.
  • Fix list() behavior inconsistency (SNAPSHOT).
  • Throwable Interface (SNAPSHOT).
  • Group Use Declarations (SNAPSHOT).
  • Uniform Variable Syntax (SNAPSHOT, partly).

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:jphp-<module>:<version>-SNAPSHOT