It's had return type declarations since 7. There's even intersection and literal types now. You could have typed this into google and it would have told you
Type declarations are still quite limited, though. For example, you can declare that a function returns an array or a string, but not an array of strings.
Come on PHP has so many shitty things, but even something basic like this is still not in the lanuage itself?
Including generic type arrays which is not supported.