From Phalcon 2.0 onwards, the framework is developed mainly using the Zephir language. Zephir is a language created by the Phalcon team, in order to ease the development of PHP extensions, and without the need to know C. The full refactoring of the framework, rewriting it from C to Zephir, has proven to be a daunting task and Zephir managed to pass with flying colors. The main goal was to ensure that the language was capable of creating PHP extensions for any purpose. The benefit of using this approach is that developers can now contribute to the framework without the need to know C, using a language that resembles Javascript or PHP and is thus easier to learn and use.
In this recipe, we will discuss the main principles of creating PHP extensions with Zephir. With the help of this recipe, you will discover how easy it is to learn and program in Zephir and, moreover, you will could find it easier to contribute to Phalcon with your ideas and bug fixes.