public static function hasProperty($subject, $property) {
    $rval = false;
    if(property_exists($subject, $property)) {
      $value = $subject->{$property};
      $rval = (!is_array($value) || count($value) > 0);
    }
    return $rval;
  }
public static function hasProperty($subject, $property) {
    $rval = false;
    if(property_exists($subject, $property)) {
      $value = $subject->{$property};
      $rval = (!is_array($value) || count($value) > 0);
    }
    return $rval;
  }
public static function hasProperty ( $ subject , $ property ) { $ rval = false ; if ( property_exists ( $ subject , $ property ) ) { $ value = $ subject -> { $ property } ; $ rval = ( ! is_array ( $ value ) || count ( $ value ) > 0 ) ; } return $ rval ; }
Returns true if the given subject has the given property.

@param stdClass $subject the subject to check.
@param string $property the property to look for.

@return bool true if the subject has the given property, false if not.
Returns true if the given subject has the given property .