function visible($obj, $key)
{
if (property_exists($obj, $key)) {
$ref = new ReflectionProperty(get_class($obj), $key);
$out = $ref->ispublic();
unset($ref);
return $out;
}
return FALSE;
}