The PS 5 is coming at the end of this year, but I wanted to get a PS 4 now.
My question is: Can you still play the games that come out of the PS 5 on the PS 4?
You can e.g. Also not playing Fortnite on the PS 3 …
Depends on the contracts. At the moment, the games are certainly still being developed for the PS4. But new developments shortly before or after the release will be for the new console.
Online games are of course a special feature because they have to be renewed again and again with patches
https://www.computerbase.de/2020-03/playstation-5-abwaertskompatibilitaet/
For the next few years, most of the titles will still be released on PS4.
Read yourself what you sent there and then the question here.