Syntactic sugar in PHP with static functions
- by Anna
The dilemma I'm facing is: should I use static classes for the components of an application just to get nicer looking API?
Example - the "normal" way:
// example component
class Cache{
abstract function get($k);
abstract function set($k, $v);
}
class APCCache extends Cache{
...
}
class application{
function __construct()
…