Zephir - Ze(nd Engine) Ph(p) I(nt)r(mediate) - is a high-level language that can be plugged-in into the Zend Engine. Code is compiled on-the-fly using a JIT compiler (LLVM).
Main features:
- Both dynamic/static typing
- Reduced execution overhead compared with full interpretation
- Restricted procedural programming, promoting OOP
- Memory safety
- Just-In-Time (JIT) compiler
Compiler design goals:
- Multi-pass compilation
- Type speculation/inference
- Allow runtime profile-guided optimizations, pseudo-constant propagation and indirect/virtual function inlining
Phalcon is written in C with platform independence in mind. As a result, Phalcon is available on Microsoft Windows, GNU/Linux, and Mac OS X. You can either download a binary package for the system of your choice or build it from sources.
To install Phalcon on Windows:
- Download Phalcon for Windows
- Extract the DLL file and copy it to your PHP extensions directory
- Edit your php.ini file and add this line:
extension=php_phalcon.dll
- Finally, restart your webserver
Hint: To ensure that your Phalcon installation was successful, debug with <?php phpinfo(); ?>
and search for a section mentioning the Phalcon extension.
On a Unix-based platform you can easily compile and install the extension from sources.
Prerequisite packages are:
- PHP 5.3.x/5.4.x/5.5.x development resources
- GCC compiler (Linux/Solaris) or Xcode (Mac)
Ubuntu:
sudo apt-get install php5-dev libpcre3-dev gcc make libllvm-3.5-ocaml-dev
Suse:
sudo zypper install php5-devel gcc make llvm-clang-devel
CentOS/Fedora/RHEL
sudo yum install php-devel pcre-devel gcc make llvm-devel
Follow these instructions to generate a binary extension for your platform:
git clone https://github.com/dreamsxin/runtime.git
cd zephir
sudo ./install
Add the extension to your php.ini:
extension=zephir.so
Finally, restart the webserver.
- A preliminary documentation can be found here
- Official Blog can be found here
- Sublime/TextMate highlight-syntax bundle here
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.