PHP's type system dissected?
summary
Explains what each PHP type actually means, shows the engine representation as a zend type structure and C checks for unions/intersections, and gives the concrete subtyping algorithm (quantifier order change that took months to get right). Demonstrates DNF types, userland limits, and ten type juggling contexts with exact surprising behaviors (string increment, array keys, comparisons). Claims strict_type declare only affects function/property scalar coercion and argues that narrow scope breaks expectations; proposes function types and generics as practical next steps.
AI-written summary · about
chapters (10)
- 0:00PHP's type system
- 1:08Type fundamentals
- 13:15Internal type representation
- 14:00Subtyping and LSP
- 22:49Subtyping rules with examples
- 28:10PHP's type juggling contexts
- 44:05Increment/decrement quirks
- 52:30Exit coercion behavior
- 54:56Strict types limitations
- 55:20Q&A








