DEV Community

Discussion on: PHP Array: A Gross Mistake

Collapse
 
suckup_de profile image
Lars Moelleken

Heyho, if you want to be sure the "thing" needs to be of a certain type, use typed collections.

They mostly already have or you can simply add e.g. the Iterator interface, and voila. 🙂 No need for falsy phpdocs in the application logic anymore.

Collapse
 
xedinunknown profile image
Anton Ukhanev

Oh, yea, totally. But I thought that you are either agreeing or disagreeing with what I wrote here, while it seems that you are adding a point about collections.

Some comments have been hidden by the post's author - find out more