- printf: documentation ( source)
<?php
interface InterfaceA {}
class ExceptionA extends Exception implements InterfaceA {}
function throwException()
{
throw new ExceptionA();
}
try {
throwException();
} catch (InterfaceA $error) {
printf('Caught %s', get_class($error));
}