- printf: documentation ( source)
<?php
function a(string $v)
{
throw new Exception;
}
try {
a("vvv");
} catch (Exception $exception) {
printf(
"%s: %s in %s:%d\nStack trace:\n%s\n",
get_class($exception),
$exception->getMessage(),
$exception->getFile(),
$exception->getLine(),
$exception->getTraceAsString()
);
}