I got a little worried about pressure treated lumber. I built some flower garden raised beds like these (I used big long galvanized spikes) and they lasted 25 years. I just ripped them out and replaced them with 4X4 lumber so hopefully they will last longer, look better. They sure cost more.
In the vegetable garden I've been using pine logs that I cut down. I planted Christmas trees about 30 years ago so the ones that grew too big need thinning out and are now just the right size for making raised beds. I only use one layer. They last several years if I cut them green, and they're safe and biodegradable.