News Archive
PhpRiot Newsletter
Your Email Address:

More information

PHP's Source Code For PHP Developers - Part 1 - The Structure

Note: This article was originally published at Planet PHP on 21 April 2600.
Planet PHP
As a PHP developer, I find myself referencing PHP's source code more and more in my normal everyday work. AIt's been very useful in everything from understanding what's happening behind the scenes to figuring out weird edge-cases to see why something that should be working isn't. AAnd it's also very useful in the cases when the documentation is either missing, incomplete or wrong. ASo, I've decided to share what I've learned in a series of posts designed to give PHP developers enough knowledge to actually read the C source code behind PHP. ANo prior knowledge of C should be necessary (we'll cover some of the basics), but it will help.
This is the first post of the series. AIn this post, we'll walk through the basics of the PHP application: where to find it, the general structure of the codebase and a few reallyAfundamentalAconcepts about the C language. ATo be clear, the goal of the series is to get a readingAcomprehensionAof the source code. ASo that means that at some points in the series, some simplifications will be made to concepts to get the point across withoutAover-complicatingAthings. AIt won't make a significant difference for reading, but if you're trying to write for the core, there is more that will be needed. AI'll try to point out these simplifications when I make them... A
Additionally, this series is going to be based off the 5.4 codebase. AThe concepts should be pretty much the same from version to version, but this way there's a defined version that we're working against (to make it easier to follow later, when new versions come out).
So let's kick it off, shall we?Read more A