【发布时间】:2014-10-18 17:55:41
【问题描述】:
assertTriggerThisException ('Exception');
assertTriggerThisException ('AnotherExceptionClass');
function assertTriggerThisException ($exceptionClassname)
{
try
{
something what triggers an exception
}
catch ($$exceptionClassname $e) // error
{
}
}
所以我想传递对类本身的引用,但这会导致语法错误。我想说“动态地”期待一个例外,有没有办法?
【问题讨论】:
标签: php