I know that PHP is a poorly typed language. But is there any alternative way to "type" a array
in PHP?
Example, I can do this below to force a given data type to be given in a function.
function exemplo(Classe $valor){
// meu código aqui ...
}
However, I would like to know how to do something like this in Java (see below) with lists.
List<String> array = new ArrayList<>;
Is there a way to do this in PHP?