Introduction to the PHP source code

php.internals

Ilija Tovilo

9 years ago
Hi everyone! I’d like to get familiar with the PHP C code base so that I can contribute back to the community and maybe even implement a small RFC at some point when I feel comfortable enough. Looking at the giant repository I feel a little overwhelmed. Is there a place where I can get started and learn more about the architecture of the interpreter before diving into the source code itself? I’m sorry if this question has been asked before. Any tips would be greatly appreciated. Thank you! Regards, Ilija

Bradley Weston

9 years ago
I'm trying to do the same thing. I've tried to fix a bug in SPL iterators. However the code is not documented anywhere and the guys on IRC aren't able to help much without dedicating their time. Maybe we can try figure it out together? https://bugs.php.net/bug.php?id=73471 Issue is at: https://github.com/php/php-src/blob/master/ext/spl/spl_iterators.c#L3385 But like I said kind of obscure. On 29/12/16 16:17, ilija.tovilo@me.com wrote:
> Hi everyone! > > I’d like to get familiar with the PHP C code base so that I can contribute back to the community and maybe even implement a small RFC at some point when I feel comfortable enough. > > Looking at the giant repository I feel a little overwhelmed. Is there a place where I can get started and learn more about the architecture of the interpreter before diving into the source code itself? I’m sorry if this question has been asked before. > > Any tips would be greatly appreciated. > > Thank you! > > Regards, > Ilija > >
-- -- *Bradley Weston [bweston.me]* Telephone: 0845 004 0662 Mobile: +44 (0) 7902 672289 This message is intended only for the use of person(s) (\"the Intended Recipient\") to whom it is addressed. It may contain information that is privileged and confidential within the meaning of applicable law. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any other person may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient please contact the sender as soon as possible. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of Legalwebb UK Ltd or any of its subsidiary businesses. Legalwebb UK Limited is Registered in Cardiff. Company Number 03874311. Registered for VAT Number 803886708. Registered Office: 169 London Road, Leicester. LE2 1EG.

Sara Golemon

9 years ago
On 29/12/16 16:17, ilija.tovilo@me.com wrote:
> Looking at the giant repository I feel a little overwhelmed. Is there a > place where I can get started and learn more about the architecture of the > interpreter before diving into the source code itself? I’m sorry if this > question has been asked before. >
phpinternalsbook.com is a start, but bear in mind it's PHP5 focused and while the general concepts are the same, a lot of important specifics have changed in 7. Broadly speaking: ext/$1/*.c <--- extension code, where $1 is the extension name (roughly). zend_module_entry is the "start point" that everything else bubbles out from. All the zend_*() APIs are in Zend/ and (most) of the others are in main/ You can follow repos like https://github.com/sgolemon/2016-sfmeetup which are concept-by-concept walkthroughs of the most essential basics. Focus on extensions to start, once you're comfortable with those, you can move confidently onto the scripting engine, sapis, etc... On Thu, Dec 29, 2016 at 10:42 AM, Bradley Weston <brad@legalweb.org.uk> wrote:
> I'm trying to do the same thing. > > I've tried to fix a bug in SPL iterators. However the code is not documented > anywhere and the guys on IRC aren't able to help much without dedicating > their time. >
You can also try http://chat.stackoverflow.com/rooms/11/php -Sara