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.
To install Zephir Parser on Windows:
- Download Zephir Parser for Windows
- Extract the DLL file and copy it to your PHP extensions directory
- Edit your php.ini file and add this line:
[Zephir Parser] extension=zephir_parser.dll
- Finally, restart your web server
NOTE: Also you can compile it yourself.
On a Unix-based platform you can easily compile and install the extension from sources.
Requirements
Prerequisite packages are:
- OS: Linux || Solaris || FreeBSD || macOS || Windows
- Compiller:
g++
>= 4.4 ||clang++
>= 3.x ||vc++
>= 11 re2c
>= 0.13
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
Follow these instructions to generate a binary extension for your platform:
git clone git://github.com/phalcon/php-zephir-parser.git
cd php-zephir-parser
sudo ./install
Add the extension to your php.ini:
[Zephir Parser]
extension=zephir_parser.so
Finally, restart the web server.
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;
var_export($retval);
echo PHP_EOL;
Zephir Parser is open source software licensed under the MIT License. See the LICENSE file for more