Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby
by the_duke on Friday June 21, 2019 @05:41AM
(#20241121)
Another huge problem is the lack of typing for arrays.
Considering the prevalence of array types in PHP, this considerably reduces the available safety.
Basically your only option is to use only classes for keyed arrays, and array wrapper classes like `MyClassArray` with typesafe methods like `push` and `get`.
Typescript solves this beautifully generics and interface types.
Considering the prevalence of array types in PHP, this considerably reduces the available safety.
Basically your only option is to use only classes for keyed arrays, and array wrapper classes like `MyClassArray` with typesafe methods like `push` and `get`.
Typescript solves this beautifully generics and interface types.