This has long been a brief excursion into the world of writing PHP extensions, but I hope I've shown you that really it's not such a hard thing to do. Sure, the macros take a bit of learning, but helper functions like zend_parse_parameters() can really lower the learning curve.
The best way to learn how to use the PHP extensions system is just to pick a problem you want to solve and dive right in. So, what are the bottlenecks in your code? Would it work if it were moved to C? Have fun!
If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!
Next chapter: Summary >>
Previous chapter: Factorials in C
Home: Table of Contents
Copyright ©2015 Paul Hudson. Follow me: @twostraws.