Car parked on the roadside.

Hanging around a roadway median, for whatever reason, could soon land you in jail.

The state House on Monday gave preliminary approval to making it a Class 3 misdemeanor for a pedestrian to be on a mean “for any purpose other than to cross a street.’’ Violators could be locked up for 30 days and face a $500 fine.

Rep. Kevin Payne, R-Peoria, who is pushing HB 2474 called it a matter of public safety.

“We can’t have people standing out in the medians,’’ he said.

“They distract drivers,’’ Payne continued. “They’re going to get hit. They have been hit in the past.’’

In pushing the bill, the only example he cited was a boy who was on the side of the road, not in a median, who was killed when a truck going around the corner clipped him.

“The same thing could happen if somebody was making a left-hand turn they would go over the median,’’ he said.

But during floor debate Monday, opponents said the legislation ignores the reason some people are in the medians in the first place.

Rep. Richard Andrade, D-Glendale, told colleagues he saw two separate instances just this past weekend in his legislative district.

One, he said, was a family collecting money to get treatment for a child with cancer. The other, said Andrade, were family members saying they were trying to raise funeral expenses.

“I want everybody to think about that,’’ he said.

“We’re prepared to throw people in jail and fining them to cover costs they can’t cover because they’re not fortunate enough because of a medical emergency, medical condition or a death,’’ Andrade said. “It’s going to imprison people for doing the thing they should be able to do with no problem.’’

Rep. Kirsten Engel, D-Tucson, said the problem is the legislation going beyond.

She said it threatens to undermine First Amendment rights of people, not only to solicit funds but also to stand in a median holding protest signs, the kinds of protests Engel said teachers engaged in during the 2018 walkout by Arizona teachers eventually resulting in Gov. Doug Ducey agreeing to significant raises.

She also suggested it could be used to harass certain people, saying it leaves it up to police to determine whether someone in a median was intending to cross the street.

And Rep. Isela Blanc, D-Tempe, questioned whether such a law is legal, citing a 2013 federal court ruling striking down a statute making begging of all kinds illegal. But this ruling involves a broader law dealing with activities anywhere, not just on roadway medians.

The legislation needs a final roll-call vote before going to the Senate.