A petitioner had challenged the law saying it was arbitrary and discriminated against both men and women.