- var_dump: documentation ( source)
<?php
class Test {
public function testing($var)
{
if ($var == 'test') {
throw new Exception('broke');
}
return true;
}
}
$test = new Test();
try {
var_dump($test->testing('test'));
} catch (Exception $e) {
echo $e->getMessage();
}