3 ms·
> Static typing: We're not there yet. Lack of generics means arrays can contain anything. Not even close to TypeScript, and let's not compare to functional lang
by conradfr 4y ago
> Static typing: We're not there yet. Lack of generics means arrays can contain anything. Not even close to TypeScript, and let's not compare to functional languages. Types in PHP is still duct-tape.
I'll admit that I personally don't care about generics (and static typing), but I find types in TypeScript more cumbersome than in PHP. Maybe that's the price to pay for extended capabilities.
Also I do Elixir professionally, which you'll agree is a functional language ;), and I would take PHP strict typing & type hinting any day over what we get in Elixir.
Performance-wise I would say it's OK these days, in a web context most of the problems come from complex data layers, like nested data in a rest api, which caching can't always solve.
It will never be as fast as Go, or Rust (or Elixir), for sure.
On the other hand, PHP 8 + Symfony + PhpStorm give you an insanely productive platform and amazing DX experience.