Coder Social home page Coder Social logo

zkc226 / jphp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jphp-group/jphp

0.0 2.0 0.0 8.35 MB

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

Home Page: http://jphp.develnext.org

License: Apache License 2.0

PHP 26.60% Java 73.17% HTML 0.07% Inno Setup 0.03% Shell 0.09% Batchfile 0.04%

jphp's Introduction

JPHP - an implementation of PHP

Build Status

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

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+ (and many language features from PHP 7.0 and 7.1).
  • JIT (~2.5x faster PHP 5.6, ~1.1x faster PHP 7.0, ~1.5x slower PHP 7.1).
  • 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 (JavaFX or SWT)
  • 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.0, 7.1?

  • All features except anonymous classes.

Own Extensions

Documentation

Getting started (Hello World)

  1. Install jphp package manager (jppm), how to install.
  2. Init new project (jppm package) with default values:
jppm init
  1. Run in console jppm start.

You will see Hello World in your console, the sources of this program will be in src/index.php.

How to run benchmarks?

// via jphp
./gradlew bench

// via php
php -f bench/src/bench.php

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

jphp's People

Contributors

austinpray avatar dim-s avatar gitter-badger avatar hnw avatar littleant avatar mrveera avatar mungell avatar popsul avatar serafimarts avatar systemxfiles avatar tirnak avatar unf0x avatar vendethiel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.