nor are they to be misled by mere pretenses.
They are at liberty —
indeed, are under a solemn duty —
to look at the substance of things,
whenever they enter upon the inquiry
whether the legislature has transcended
the limits of its authority.
a statute purporting to have been enacted
to protect the public health, the public morals, or
the public safety,
has no real or substantial relation to those objects, or
is a palpable invasion of rights secured by
the fundamental law,
it is the duty of the courts to so adjudge, and
thereby give effect to the Constitution.
-- Mugler v. Kansas
Source: Mugler v. Kansas, 123 U.S. 623, 661.