AssertValidity is a library that allows you to validate variables and function/method arguments.
/**
*
* @param string $a
*/
function test($a)
{
AV::arg(__FUNCTION__, func_get_args());
}
test("1"); //ok
test(1); // InvalidArgumentException thrown