1.2.894. Or Die¶
Classic old style failed error management.
Interrupting a script will leave the application with a blank page, will make your life miserable for testing. Just don’t do that.
<?php
// In case the connexion fails, this kills the current script
mysql_connect('localhost', $user, $pass) or die();
?>
See also pg_last_error and PDO::exec.
1.2.894.1. Suggestions¶
Throw an exception
Trigger an error with trigger_error()
Use your own error mechanism
1.2.894.2. Specs¶
Short name |
Structures/OrDie |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
ClearPHP |
|
Examples |
|
Available in |