I have a problem with static keyword due to inheritance in PHP 5.3.
abstract class Object
{
protected static $_classDataSource = null;
public static function getDataSource()
{
return static::$_classDataSource;
}
public static function setDataSource( $dataSource)
{
static::$_classDataSource = $dataSource;
}
}
class Film extends Object
{
}
class Actor extends Object
{
}
Film::setDataSource('FFF');
Actor::setDataSource('aaa');
echo Film::getDataSource();
echo Actor::getDataSource();
Result is: aaaaaa Expected result: FFFaaa
What should I do to make it as expected?