I would like to check the type of a parameter matches, before I enter a the function.
function ((int) $integer, (string) $string ) { /*...*/ }
As opposed to
function ( $int, $string ) {
$string = (string) $string;
$int = (int) $int;
}
Is there a way to do this? I've also speculated in doing it as object
function ( Integer $int ) { /*...*/ }
By doing this I could send a functionName ( new Integer ( $int ));
but I would love to not have the added syntax.