Is PHP 7.1 performing at its best?

I can’t say the most, although PHP 7.1 is now so fast, it is still not as fast as other languages in some scenarios. This has a lot to do with its natural features like dynamics, symbol tables, and indirect references. The biggest thing PHP 7.1 does compared to 7.0 is a type inference system with a type-dependent intermediate code execution engine. This is not a new work. In 2013, when we did JIT for PHP 5.5, the type inference system had been developed, but the project was stopped. Now, take the type inference part of that work and put it in 7.1. More can be done in the future based on this type of inference. PHP 7.1 is more of a complement to what 7.0 left undone. I don’t really like the new features of PHP 7.1

I found a PHP JIT related open source project JPHP to understand


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

How does it work? JPHP is a compiler javac that compiles PHP source code into JVM bytecode, which can then execute the results on the Java VM.

  • Official website: J-php.net

In the production

We develop a new IDE for beginners, such as Game Maker or Scirra Construct. It is based on JPHP, JavaFX, Java 8, Gradle, and allows the creation of board games and applications for Linux, Windows, and Mac (possibly Android and other platforms in the future). Developer Next (github.com/jphp-compil…) The current status and version of the project is BETA. The project has not been localized in English.

The target

JPHP is not a replacement for Zend PHP engine or Facebook HHVM. We are not going to implement the Zend runtime libraries (e.g. Curl, PRCE, etc.) for JPHP.

Our project started in October 2013. Here’s why:

  1. Ability to use Java libraries in PHP
  2. Upgrade performance with the JIT and JVM
  3. Replace Zend PHP’s ugly runtime library with a better one.
  4. PHP is not only used on the web
  5. Also: Unicode for strings and threads

Characteristics of the

What does JPHP support from PHP 7.0,7.1?

  • Context sensitive Lexer.
  • Fix inconsistent list () behavior.
  • Throwable interface.
  • Group usage declaration.
  • Scalar and optional type hints.
  • Return type hint.
  • Invalid and rewritable type hints.
  • Uniform variable syntax (part).
  • Null merge operator??.
  • Multiple catch syntax.
  • Short list syntax.
  • The list of keys.
  • Class constant visibility modifier.
  • Spacecraft operator< = >.
  • Generator delegationyield from.
  • The generator returns an expression.
  • intdiv()Function.

The document

  • Wiki is here: Read
  • You can find the latest API documentation here: HTTP: //jphp-docs.readthedocs.org/
  • To contribute to the API documentation, you can forkdocsProject:https://github.com/jphp-compiler/docs

Introduction (Hello World)

J-php.net/wiki/Gettin…

Heat running benchmarks?

// via jphp
./gradlew bench

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

Copy the code

Build SNAPSHOT from source code

Use Gradle Install to build and install JPHP modules and libraries into the local Mavel library. After that, you can use JPHP as a Maven dependency in your projects.

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


Original text: github.com/jphp-compil…