function constants($class,$prefix='') {
		$ref=new ReflectionClass($class);
		$out=array();
		foreach (preg_grep('/^'.$prefix.'/',array_keys($ref->getconstants()))
			as $val) {
			$out[$key=substr($val,strlen($prefix))]=
				constant((is_object($class)?get_class($class):$class).'::'.$prefix.$key);
		}
		unset($ref);
		return $out;
	}