On Fri, Sep 26, 2008 at 4:12 PM, Roan Kattouw roan.kattouw@home.nl wrote:
If constants are passed as function arguments as they usually are, the warning would occur on the calling line, not in the function itself, so you immediately know who the caller is.
Yes, which makes the strings slightly more complex in that regard. But to recap their benefits:
* Human-readable in stack traces and other sorts of dumps. * Shorter due to no possibility of namespace conflicts. * More human-readable in source code (no all-caps or incomprehensible prefixes). * Can be used in LocalSettings.php and other places before AutoLoader is executed, unlike class constants (you need to use global constants, which suck even more than class constants). * No confusion about how to combine them. (How many times have you seen someone say to set error_reporting( E_ALL & E_STRICT )? I've seen it more than once.) * Easier extensibility: extensions don't have to worry about conflicting with core code when defining new parameters, unlike with parameters that are secretly numeric. * Probably others that I'm not thinking of this second, where was my last post on this? I can't find the thread.