1<?php
2try {
3 /* ... */
4} catch (FirstException $ex) {
5 $this->manageException($ex);
6} catch (SecondException $ex) {
7 $this->manageException($ex);
8}
9?>
10
11<------------------------- To --------------------->
12
13<?php
14try {
15
16} catch (FirstException | SecondException $ex) {
17 $this->manageException($ex);
18}
19?>
1try
2{
3 // Some code...
4}
5catch(AError | BError $e)
6{
7 // Handle exceptions
8}
9catch(Exception $e)
10{
11 // Handle the general case
12}