Objects with setters or getters can mask the stain
Issue #3045098 on drupal.org by John Franklin.
Classes like the following block the attempts by Krumo to stain an object and can cause infinite recursion.
class UnstainableReadOnlyExample {
function __construct() {
// fetch values externally
}
function __set($name, $value) {
// Read-only object
return;
}
}
class UnstainableReadFilteredExample {
static $valid_props = array('foo', 'bar', 'baz');
function __get(name) { if (in_array(name, $this->valid_props)) {
return this->name;
}
return NULL;
}
}