- array_diff: documentation ( source)
<?php
try {
$a->test();
}catch(Throwable $ee){
echo "Catched exception: " . $ee->getMessage() . "\n";
}
//Third case: let's trigger a slightly different error
try {
$stdObject = new StdClass();
array_diff([$stdObject], [$stdObject]);
}catch(Throwable $ee){
//Handler is called, exception is thrown but... IT IS NOT CATCHED!
echo "Catched exception: " . $ee->getMessage() . "\n";
}