Re: Codenumbers in MDB2
| From: | Christian Weiske | Date: | Tue, 10 Jul 2012 06:45:15 +0000 |
| Subject: | Re: Codenumbers in MDB2 | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-31592@lists.php.net to get a copy of this message | ||
Hello Bernhard,
> i want to ask if one can use the integer values defined for errors and
> modes instead of constant names.
Yes, you can use them. Changing the values of the constants would be a
backward compatibility break, so you're on the safe side.
Note that using constant names mostly makes your code more
understandable, because
if ($error == 3828) {
do_this();
}
is not as understandable as
if ($error == MDB2_Error::INVALID_PASSWORD) {
do_this();
}
(pseudocode)
--
Regards/Mit freundlichen Grüßen
Christian Weiske
-= Geeking around in the name of science since 1982 =-