Php verifique si el objeto tiene atributo
if(property_exists($car,color)){
//$car->color exists
}
Grepper
if(property_exists($car,color)){
//$car->color exists
}