- var_dump: documentation ( source)
<?php
class A {
function get()
{
throw new Exception('some error');
}
}
class B {
function __toString()
{
$a = new A;
return $a->get();
}
}
$b = new B;
var_dump((string) $b);