Hacker News new | ask | show | jobs
by Shish2k 807 days ago
> It has strong typing, not just hints in comments

Even for arrays?

1 comments

PHP arrays are ordered maps, not arrays of a homogenous type as in Go or Java. Array is a type in PHP, but all arrays have the same type, regardless of what they contain.

You can describe the expected value or key/value types of an array in PHP doc comments for IDEs and static analyzers, but PHP won't enforce those.