Re: [PHP] class const versus define

2008-09-24 Thread Jochem Maas
Richard Lynch schreef: Is there any reason why the logic behind define() couldn't be pushed down to class const? probably no reason why it couldn't but from what I gather there is a specific reason wht it works like this: speed. const is compile time, define is runtime IIRC const was made th

[PHP] class const versus define

2008-09-23 Thread Richard Lynch
Is there any reason why the logic behind define() couldn't be pushed down to class const? Code like this is kinda fugly: //It's okay here, but not in a class? define('CACHE_DIR_LONG', CONFIG_ROOT_PATH . '/cache/'); class Cache { const CACHE_DIR = '/dev/shm/cache/'; const CACHE_TTL = 300; //