PHP Traits, Threat or Treat?
summary
Claims concrete results: PHP 5.4 cuts CPU from 600ms to 168ms and memory from ~14MB to ~8MB in a cloned VM benchmark using XHProf, and traits offer reuse by being copy‑pasted into classes at compile time, with clear rules for conflicts via insteadof and renaming so you can implement interfaces by aliasing methods. Gotchas: static properties behave per‑class, no instanceof for traits, and method renames complicate refactoring.
AI-written summary · about
chapters (20)
- 0:00Intro
- 0:56PHP vs Java
- 1:30PHP Version Adoption
- 2:54Why is there a slow adoption
- 4:02Why would you adopt
- 4:57Array Short Notation
- 8:06Root Broker
- 9:20Multiple Inheritance
- 9:57PHP Traits
- 21:55Multiple PHP Statics
- 25:48PHP Methods Visibility
- 26:41Interfaced Compliance
- 26:56Interface Set Options
- 29:19Abstraction
- 31:03Magic Constant
- 31:54Outer Loading
- 34:04The Bad
- 36:15Benchmarks
- 36:45Upgrade
- 38:16PHP 54








