Is styrofoam soluble in gasoline or paint thinner?
Unless you're trying to make napalm, don't use gasoline.

Use acetone. It dissolves egg cartons within just a few minutes, and you can then take it out and reshape it (use gloves!). Set it out to dry and once the acetone has evaporated, it should be a (crude) solid.

Just ensure whatever container you're using to hold the acetone isn't polystyrene. Check to make sure recycling code 6 isn't on the container. I had a pretty good laugh at my teacher one day who poured acetone into a red solo cup and it went running all over the table.