Is it possible to define a function argument as several possible types? For example, a function may take a string or an integer to do something. Is there any way to define it like that?
function something(int|string $token) {}
Or is only one type supported for an argument?
(note, I know that I can filter the input later, I just like my arguments)
source
share