Zephir is a compiled high level language aimed to the creation of C-extensions for PHP
- dev-master / 1.0.x-dev
Zephir - Ze(nd Engine) Ph(p) I(nt)r(mediate) - is a high level language that eases the creation and maintainability of extensions for PHP. Zephir extensions are exported to C code that can be compiled and optimized by major C compilers such as gcc/clang/vc++. Functionality is exposed to the PHP language.
- Both dynamic/static typing
- Reduced execution overhead compared with full interpretation
- Restricted procedural programming, promoting OOP
- Memory safety
- Ahead-of-time (AOT) compiler to provide predictable performance
Compiler design goals:
- Multi-pass compilation
- Type speculation/inference
- Allow runtime profile-guided optimizations, pseudo-constant propagation and indirect/virtual function inlining
To compile zephir-parser:
To build the PHP extension:
- g++ >= 4.4/clang++ >= 3.x/vc++ 9
- gnu make 3.81 or later
- php development headers and tools
You can install zephir using composer.
composer require phalcon/zephir, run
./install and then run
bin-dir. By default it is
You can read more about composer binaries
in it's documentation.
For global installation via composer you can use
composer global require.
Do not forget add
~/.composer/vendor/bin into your
Also you can just clone zephir repository and run
For global installation add
The following packages are needed in Ubuntu:
- apt-get install re2c libpcre3-dev
Compile the extension:
Zephir is open-sourced software licensed under the MIT License. See the LICENSE file for more information.
See CONTRIBUTING.md for details about contributions to this repository.
Zephir is built under Travis CI service. Every commit pushed to this repository will queue a build into the continuous integration service and will run all PHPUnit tests to ensure that everything is going well and the project is stable. The current build status is: