Dolibarr/dolibarr — pull request #1687 by KreizIT (2014-06-25 16:02:00+00:00)
Title: Add feature to inform error is deprecated

Could be usefull for chasing down usage of error or other property.
You could use this to test undeclared property also by changing else part of __set to :
if (property_exists($this, $name)) {
$this->$name = $value;
return;
} else {
trigger_error("Undefined property in __set(): {$name}");
}

and else part of __get to :
if (property_exists($this, $name)) {
return $this->$name;
}
else {
trigger_error("Undefined property in __get(): $name");
return NULL;
}