News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Getting Started with PHP Extension Development via Zephir
April 09, 2014 @ 10:26:22

The SitePoint PHP blog has posted an introductory tutorial helping you get started with extension development with Zephir, a language that aims to make extension development easy and fast.

This tutorial will explain how to create a PHP extension using a new language: Zephir, which is similar to C and Fortran. You can download the full source code from github. We've touched on the concept of Zephir before, so if you're interested in getting a broad overview, see our previous articles. Zephir can be looked at as a hybrid language that lets you write code that looks like PHP, but is then compiled to native C, meaning you can create an extension from it and come away with very efficient code.

He starts with a list of dependencies you'll need to get an extension compiled and working with Zephir including the gcc compiler and json-c. He shows you how to install Zephir from Github and update your path to make the executable available. As his example extension, he creates a tool that can calculate the result for the time-dependent Schrödinger equation (don't worry, the complete Zephir code for the extension is included in the tutorial). He includes the commands to initialize the Zephir project, code for the various classes involved and the expected output from the compilation. Finally, he includes a bit of PHP code to test out the newly built extension and its output.

0 comments voice your opinion now!
tutorial zephir extension language compile equation

Link: http://www.sitepoint.com/getting-started-php-extension-development-via-zephir/

blog comments powered by Disqus

Similar Posts

Ivo Jansch's Blog: Validating OCL constraints in PHP objects

Perplexed Labs Blog: PHP Forking to Concurrency with pcntl_fork()

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 10)

VG Tech: Swagger Docs in ZF2 with Examples - Part 2: Swagger UI

William Candillon's Blog: Running Zorba with PHP


Community Events





Don't see your event here?
Let us know!


laravel language release testing series refactor wordpress framework unittest community list code podcast install interview developer opinion configure introduction threedevsandamaybe

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework