What was that spiny dried up desert plant?

I was staying in a motel in southern California in a pretty desert area. I found a big round dried up yellow plant that the wind blew in the parking lot next to my car. It was also pretty spiny. I eventually got it and threw it in the motel's dumpster.

What was that plant?
Update: Also, were I supposed to throw it in the dumpster considering it was very spiny and too big space?
2 answers 2