Attribute validations in PHP