In regards to Error handling in PHP -- As far I know there are 3 styles:

1. `die()`or `exit()` style:

```
$con = mysql_connect("localhost","root","password");

if (!$con) {
 die('Could not connect: ' . mysql_error());
}

```
2. `throw Exception` style:

```
 if (!function_exists('curl_init')) {

      throw new Exception('need the CURL PHP extension. 
                           Recomplie PHP with curl');
    }

```
3. `trigger_error()` style:

```
if(!is_array($config) && isset($config)) {
        trigger_error('Error: config is not an array or is not set', E_USER_ERROR);
    }

```

Now, in the PHP manual all three methods are used. 

* What I want to know is which style should I prefer & why?
* Are these 3 drop in replacements of each other & therefore can be used interchangeably?

Slightly OT: Is it just me or everyone thinks PHP error handling options are just *too many* to the extent it confuses php developers?