unit converter class written in PHP