PHP Internals for the Inquisitive Developer
summary
Walks through the PHP request lifecycle, shows how SAPIs and Zend vs module extensions actually register, and explains PHP 7 internals: zvals move off the heap, reference counting shifts to complex types, and strings embed length and data. Demonstrates source navigation with LXR and bytecode inspection with VLD, explains opcache shared memory for FPM workers and a few opcode optimizations, and shows crash debugging via gdb and strace/ltrace with a real recursion segfault that produces 46,000 frames.
AI-written summary · about
chapters (24)
- 0:00Intro
- 0:44A Little About Myself
- 1:48Some Topics to Cover
- 4:16Everything Starts Here
- 5:33Server APIs
- 8:00Types of Extensions
- 10:36Module Scope
- 11:13Request Scope
- 12:50Process Model
- 13:15Thread Model
- 13:45Global Scope
- 14:36PHP Process Manager
- 18:35Zval Improvements in PHP 7
- 21:57Types and Attributes
- 31:17Interpretation vs. Compilation
- 33:01Parsing Tokens (token get_all)
- 37:00Opcode Caching
- 38:49OpCode Optimizations
- 43:35Tracing System Calls (strace)
- 43:59Tracing Library Calls (Itrace)
- 44:15Debugging Crashes (gdb)
- 44:57Capturing a Core Dump
- 45:24Traversing the Backtrace
- 46:12Resources and Further Reading
