Introduction to PHP Extensions
summary
Converts a PHP function into a loadable C extension, showing the actual build steps (phpize, configure, make), the API calls used (zend_parse_parameters, PHP headers and macros), and the test setup (.phpt tests, pecl-friendly config.m4); implements a geospatial polygon-simplification library and measures real speedup — an example goes from 45s → 0.33s in PHP vs C — and shows the size, memory-care and return-value details that make the extension practical rather than theoretical.
AI-written summary · about
chapters (12)
- 0:00Intro
- 1:31What are extensions?
- 3:56Wrapping Ubraries
- 4:54Unpossible in userland
- 6:28Why not implement something in an
- 9:38Ramer-Douglas-Peucker algorithm
- 10:59What makes up an Extension?
- 17:14Building the Extension
- 27:48Implementing the function
- 28:52Parsing Input Parameters
- 44:50Memory Management
- 46:08Example Test File








