Slide 20
Slide 20 text
getMessage().PHP_EOL;
} catch (Exception $e) {
echo "Exception: ".$e->getMessage().PHP_EOL;
}
//Type error
try {
function add(int $a, int $b):int {
return $a + $b;
}
echo add(array(), array());
} catch (TypeError $t) {
echo "Type error: ".$t->getMessage().PHP_EOL;
}