Using Constants
Posted: Wed Oct 05, 2005 4:08 pm
Is it ok to use constants in many of my written classes? Since constants are global, including a file with a bunch of define()'s in the main script makes them available to all objects used in that script. Those aren't any special data or anything, just language strings (translated user-end messages/errors etc). It's very convenient for me this way, I can simply use eg in some class and be fine with it. But is it an ok way to do it? What if the file get's larger? Say, a few hundred define()'s? Could there be any performance issues?
Code: Select all
$this->error = LANG_548;