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;
	}
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;
	}
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 ; }
Convert class constants to array
@return array
@param $class object|string
@param $prefix string
Convert class constants to array