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:
PHP Extension Development with PHP-CPP Object Oriented Code
April 08, 2014 @ 09:11:17

The SitePoint PHP blog has posted the second part of their look at the PHP-CPP tool and how to use it for developing PHP extensions. In this second part of the series Taylor Ren builds on what was learned in part one and talks more about the OOP features of the tool.

In this part, we further elaborate its OO features. We will mimic a complex number (in the form of 3+4i) class to demonstrate some more useful and powerful sides of the PHP-CPP library.

He walks you though a few changes to the environment files (the .ini configuration file and the Makefile) to set things up. He then gets into the C++/PHP constructor and getters and setters for private class variables, much like PHP's __get and __set. His example shows a set of methods that do some mathematical calculations including one to show the result in a "more friendly way". He includes the code for registering these functions and, finally, the steps to compile, install and test the extension.

0 comments voice your opinion now!
phpcpp extension development part2 series oop code

Link: http://www.sitepoint.com/php-extension-development-php-cpp-object-oriented-code

blog comments powered by Disqus

Similar Posts

DevShed: Finding Paths, Timestamps and More with the DirectoryIterator Class in PHP

PHPBuilder.com: Use the PHP Filter Extension to Validate User Data

Adam Culp: Clean Development Series: Part 4, Rewrite dilemma

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

Paul Jones\' Blog: PHPBlox from Zend?


Community Events





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


package opinion update interview symfony release library composer laravel series tool community voicesoftheelephpant version security install framework introduction podcast language

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