What are the drawbacks to using a class with only static methods in PHP as a wrapper for common functions? Especially if I don't need more than one of something, or I want some sort of global controller.
For example:
class SomeClass{
private static $somedata = null;
public static function setdata($value)
{
self::$somedata = $value;
}
public static function getdata()
{
return self::$somedata;
}
}
class AnotherClass{
public static function modifydata($value)
{
someClass::setdata($value);
}
}
SomeClass::setdata('firstval');
// returns 'firstval'
echo SomeClass::getdata();
AnotherClass::modifydata('secondval');
// returns 'secondval'
echo SomeClass::getdata();
I don't see this done commonly, and it seems like a pretty simple way to handle things, or am I just completely off base? What are the advantages / disadvantages to approaching things this way when building PHP applications?