Now, Build PHP Extensions Without Knowing C

PHP is build in C language so if you want to build extensions for PHP then you need to know C. Now, with a framework available to act as middleman, you can build PHP extensions in PHP.

Zephir is one such framework written to write PHP extension. It is in beta stage. It offers you to write your applications as low level also to protect code.

Zephir is being developed by Phalcon team to help build extension.

Phalcon is a web framework implemented as a C extension offering high performance and lower resource consumption.

phalcon logo

Goals

The main goals of Zephir’s are:

  • Static/Dynamic typing
  • Automatic memory management
  • Strict and explicit behavior over flexible and implicit behavior
  • Produce object-oriented libraries that can be used in PHP
  • Hide unnecessary complexity to developers
  • Make the code more debugable
  • Produce exceptions in runtime instead of notices/warnings when possible
  • Detect potentially slow or unrechable code and notify the developer about it
  • Produce faster and better code that can be compiled by most important C-compilers: (gcc, vc++, clang)
  • Provide a very low learning curve without creating a new PHP/C implementation
  • Main Phalcon’s goals using Zephir:

  • Reduce the development time
  • Make the code less prone to coding errors
  • Allow more members of the community to get involved in
  • Allow most Phalcon’s users to read and understand how a functionality is implemented
  • Allow developers to take more advantage of the framework fully understanding how it works by reading its code
  • Introduce potential refactoring and optimizations without affect the stability
  • Easily adapt the code to new PHP versions
  • Allow contributors to implement additional components
  • What Zephir will not be:

  • The next kick-ass language for the web
  • A replacement for PHP or C (or any other language)
  • Be the most elegant and coherent language available
  • Cover every possible feature (current or future) provided by PHP or C
  • Implement every feature working exactly as in PHP or C
  • Provide awesome expresiveness or support every possible programming paradigm
  • Make everyone happy
  • Source:

     

    Zephir – Build PHP Extensions Without Knowing C
    Phalcon 2.0 - The future