Zephir is a compiled high level language aimed to the creation of C-extensions for PHP
PHP C Zephir C++ HTML PowerShell Other
Clone or download
Permalink
Failed to load latest commit information.
Library Bump version [ci-skip] Aug 5, 2018
bin disable timecop extension from the launcher Oct 13, 2017
ext Fixed "sh: 1: cd: can't cd to ext" Nov 30, 2016
kernels Delete Casting for ZE2 Aug 5, 2018
modules Remove modules/php-zephir-parser (see #1471) Apr 3, 2017
prototypes Amended gd prototype Dec 28, 2017
runtime Updated Copyright Oct 12, 2017
templates Expand existing lifecycle configuration support May 24, 2018
test Add type hints for scalar arguments and return values in Zend3 Aug 5, 2018
unit-tests Add type hints for scalar arguments and return values in Zend3 Aug 5, 2018
.editorconfig Fix some testing settings Aug 5, 2018
.gitattributes Added sha to Zephir version when possible May 22, 2016
.gitignore Add dev version of Zephir Parser to build matrix Oct 12, 2017
.travis.yml Fix some testing settings Aug 5, 2018
CONTRIBUTING.md Export symbol using string Aug 22, 2014
LICENSE Fixed LICENSE [ci skip] Nov 10, 2017
README.md Updated README [ci skip] Apr 17, 2018
WINDOWS.md PHP SDK 2.0 is now hosting on Github Sep 19, 2017
appveyor.yml Bump version [ci-skip] Aug 5, 2018
bootstrap.php Add type hints for scalar arguments and return values in Zend3 Aug 5, 2018
compiler.php Cleaned Bootstrap Oct 10, 2017
composer.json Normalize composer.json Aug 5, 2018
config.json Fixed globals_set Apr 17, 2018
install Updating year to 2016 [ci skip] Apr 25, 2016
install-nosudo Fixed install-nosudo Aug 13, 2016
phpunit.xml.dist Tune up PHPUnit Aug 5, 2018

README.md

Zephir

Latest Stable Version Total Downloads License Build on Linux Build on Windows

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.

Main features:

  • 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

Requirements

  • re2c >= 0.13.6
  • Zephir Parser >= 1.1.0
  • A C compiler such as gcc >= 4.4 or an alternative such as clang >= 3.0, Visual C++ >= 11 or Intel C++. It is recommended to use gcc 4.4 or later
  • GNU make >= 3.81
  • automake
  • PHP development headers and tools
  • The build-essential package when using gcc on Ubuntu (and likely other distros as well)

Installation

NOTE: The development branch will always contain the latest unstable version. If you wish to check older versions or formal, tagged release, please switch to the relevant branch/tag.

Windows

To install Zephir on Windows follow this guide.

Linux | macOS | BSD | Solaris

Git way

Clone Zephir repository.

Then, install Zephir by using command ./install from project root dir. For global installation add -c flag.

Composer way

You can install Zephir using composer.

To get Zephir, run composer require phalcon/zephir.

Additional notes on Ubuntu

The following packages are needed in Ubuntu:

  • apt-get install re2c libpcre3-dev

Usage

Compile the extension:

zephir compile

External Links

Contributing

See CONTRIBUTING.md for details about contributions to this repository.

License

Zephir is open-sourced software licensed under the MIT License. See the LICENSE file for more information.