Re:Parse, Don't Validate (2019)
by cogman10 on Tuesday February 10, 2026 @01:07PM
(#46964123)
Benchmark it, but from what I can find this is dated advice. It might be faster on first load but it'd surprise me if it's always faster.
Edit: looking into how PHP has evolved, 8 added a JIT in 2021. That will almost certainly make it faster to use a class rather than an associative array. Associative arrays are very hard for a JIT to look through and optimize around.
Edit: looking into how PHP has evolved, 8 added a JIT in 2021. That will almost certainly make it faster to use a class rather than an associative array. Associative arrays are very hard for a JIT to look through and optimize around.