You... get both, so you can play with the download on your PS4 and then if, or when, you get a PS5 you can carry on with the PS5 version. Otherwise you'll end up having to pay either $10 to upgrade or buy the game all over again (and if you buy the digital edition PS5 and you only have the disc version of the PS4, you'll have to buy a whole new PS5 version).
The only limitation is that if you get the physical version, you can only play it in a regular PS5. If you get the digital version, you can play it in either the regular PS5 or the digital edition PS5.