捕获多种异常类型

版本新特性 / PHP 7.1

// *** before: ***
try {
    process();
} catch (InvalidArgumentException $e) {
    report($e);
} catch (RuntimeException $e) {
    report($e);
}

// *** in version 7.1: ***
try {
    process();
} catch (InvalidArgumentException | RuntimeException $e) {
    report($e);
}