Let's be controversial: In modern #PHP, you should never type-hint an array.
Let's be controversial: In modern #PHP, you should never type-hint an array.
@chrastecky Array as a simple list, sure. But then you're going to most likely iterate it, and so you can type it iterable instead.
But yes, the real villain is arrays as pseudo-objects.
@Crell iterable is fine if you're going to iterate, but if you want to use one of the plethora of array functions, you have to either write your own which work with iterables, typehint it as an array or convert the iterable to an array.
Iterables are sadly not as usable out of the box as arrays are.
Edit: But yeah, arrays as object wannabes are the biggest problem.