The Zephir Parser delivered as a C extension for the PHP language.

Installs: 1 591

Dependents: 1

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 22


1.1.2 2018-09-08 10:56 UTC


Build on Linux Build on Windows

The Zephir Parser delivered as a C extension for the PHP language.

Supported PHP versions: 5.5, 5.6, 7.0, 7.1, 7.2

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.

Get Started


NOTE: Since version 1.1.2, DLLs are no longer provided for PHP 5.x. Windows users with PHP 5.x should use Zephir Parser <= 1.1.1.

To install Zephir Parser on Windows:

  1. Download Zephir Parser for Windows
  2. Extract the DLL file and copy it to your PHP extensions directory
  3. Edit your php.ini file and add this line:
    [Zephir Parser]
  4. Finally, restart your web server

NOTE: Also you can compile Zephir Parser yourself. For more see: README.WIN32-BUILD-SYSTEM.


On a Unix-based platform you can easily compile and install the extension from sources.


Prerequisite packages are:

  • OS: Linux || Solaris || FreeBSD || macOS || Windows
  • Compiller: g++ >= 4.4 || clang++ >= 3.x || vc++ >= 11
  • re2c >= 0.13.6


sudo apt-get install php7.0-dev gcc make re2c autoconf


sudo zypper install php7.0-devel gcc make re2c autoconf


sudo yum install php-devel gcc make re2c autoconf

General Compilation

Follow these instructions to generate a binary extension for your platform:

git clone git://
cd php-zephir-parser
sudo ./install

Add the extension to your php.ini:

[Zephir Parser]

Finally, restart the web server.

Advanced compilation

If you have specific php versions running (for example 7.2):

sudo ./install  --phpize /usr/bin/phpize7.2 --php-config /usr/bin/php-config7.2


$path   = __DIR__ . '/test.zep';
$retval = zephir_parse_file(file_get_contents($path), $path);

echo PHP_EOL;
echo PHP_EOL;


Zephir Parser is open source software licensed under the MIT License. See the LICENSE file for more