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

Installs: 2 263

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 36


1.5.3 2023-02-10 16:10 UTC

This package is auto-updated.

Last update: 2024-07-10 19:09:58 UTC


Actions Status Coverage Status License Discord

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

Supported PHP versions: 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 and 8.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

Build Requirements

Prerequisite packages are:

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

To build extension from the source you will need the PHP development headers. If PHP was manually installed, these should be available by default. Otherwise, you will need to fetch them from a repository.


pecl install zephir_parser


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]


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

For Linux/Unix-based based systems you'll need also:


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


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


sudo yum install php-devel gcc make re2c autoconf automake

General Compilation

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

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

If you have multiple/specific PHP versions installed, you may be able to specify for which installation you'd like to build by using the --with-php-config option during configuration. For example:

git clone git://
cd php-zephir-parser
./configure --with-php-config=/usr/local/bin/php-config
sudo make install

Add the extension to your php.ini:

[Zephir Parser]


$program = <<<EOF
namespace Acme;

class Greeting
    public static function sayHello() -> void
        echo "Hello, World!";

$retval = zephir_parse_file($program, '(eval code)');



Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]


Support us with a monthly donation and help us continue our activities. [Become a backer]


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