Pennsylvania’s Supreme Court justices grilled an attorney representing lawmakers who backed a legislative amendment ­allowing challenges to local gun ordinances, ­asking what single subject tied the bill together.

The parties sparred before the justices Wednesday over whether the legislative approval of a statute creating standing for firearm owners and groups to challenge local gun control measures was constitutional.