multi catch for try php
snippet in php

multi catch for try php

user9811

<?php
try {
    /* ... */
} catch (FirstException $ex) {
    $this->manageException($ex);
} catch (SecondException $ex) {
    $this->manageException($ex);
}
?>
  
<------------------------- To --------------------->
  
<?php
try {

} catch (FirstException | SecondException $ex) {
    $this->manageException($ex);
}
?>