moyeea
0
Q:

multi catch for try php

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

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

New to Communities?

Join the community