At the start of the UK lockdown in 2020, I was lucky enough to have ordered some a 5' Olympic bar and some weight plates before they sold out everywhere. Couple of years on, and having acquired a power rack, I'm looking at upgrading to a 7' one, so hopefully some of this will help.
Weight
Doesn't always follow, but my 5' bar is 15kg, whereas most standard 7' bars are 20kg. You can get technique 7' bars that can weigh 10kg - 15kg, but I'm not certain if you can get a 5' bar weighing 20kg
Storage
Main reason I initially went for 5' bar was I could store it a lot easier than a 7' one.
Load
I can't find the spec for my 5' bar, but I'm pretty sure it has a 180kg maximum load. 7' bars can be rated for much higher load (though not all are, check before buying).
Exercises
The only exercise I found that I can't do on a 5' bar (see note on length below) is anything requiring a snatch grip (deadlifts or any of the snatch assistance exercises). I stand 6' 5" tall, with the same wingspan, so the bar simply isn't long enough for me to use a proper snatch grip. If you're shorter, you may not have the same issue.
Length
Obviously, 5' is shorter than 7'. On my 5' bar, the length you grip (the shaft) is substantially shorter than a 7' bar, besides giving me issues with snatch grip exercises, this means it doesn't fit in a standard power rack normally. I can make it fit if I put the sleeves on the rack pins and pad the plates with collars, but it's not exactly secure, and I wouldn't want to load it much.
If you have adjustable squat stands, then you can probably adjust for this, but not with a traditional power rack.
Variety and availability
Quite simply, 7' Olympic bars are more common, and so are generally more available for purchase, meaning you might be able to find them second hand, or cheaper than a 5' one (yes, I know it sounds wrong, but at least currently, that is the case). You can also get a much wider variety of 7' bars because they're more common.
A quick look at a standard fitness store, you can get a single 5' bar, or for the 7' ones, you can get technique bars, smaller diameter bars, powerlifting bars (the knurling is different on power lifting and Olympic lifting bars), ones with higher load capacity, etc, etc.
Conclusion
It all comes down to what you want it for. I've spent a couple of years training with a 5' bar, because it suited my needs. Now, my needs have changed, so I'm in the market for a 7' bar.
(Additional information https://homegymresource.com/the-complete-guide-to-barbells-everything-you-want-to-know/)