Physicians appointed by the court to examine any person pursuant to this subchapter and counsel assigned by the court to represent any person in commitment proceedings under this subchapter are entitled to reasonable compensation, in an amount to be determined by the court, to be paid, upon order of the court, out of the funds as may be provided by law.