Variables variable and inheritance
- by Xack
I made code like this:
class Object {
function __get($name){
if(isset($this->{$name})){
return $this->{$name};
} else {
return null;
}
}
function __set($name, $value){
$this->{$name} = $value;
}
}
If I extend this class (I don't want to repeat this code every time), it says "Undefined variable". Is there any way to do it?