Can a PS4 gamer play online with an Xbox One gamer?
As Jeff has already said, no, there is no cross-platform play between the PS4 and Xbox One, or any other consoles for that matter.
There have been rumors of it happening for years but I personally cannot ever see it happening. The main reason being it would harm Sony and Microsoft's desire to build their own ecosystems. Right now you'll have gamers buying both consoles to get all the games and to be able to play against all their friends. Bring cross-platform gaming in and end exclusivity, and that's no longer going to happen.
The short answer for you is no because Microsoft prevents cross-platform gameplay. I have a feeling that this won't be the case for very much longer, as more gamers demand this feature the more reluctant Microsoft will be to remain willfully ignorant of our needs. Have a look at the following articles.
Microsoft won't allow Xbox One/PC cross-platform play, says War Thunder dev - gamespot.com
Why don’t the PS4 and Xbox One have cross-generation multiplayer? - extremetech.com
Why Is War Thunder On PS4 And Not Xbox One? Because Microsoft Prevents Cross-Platform Play - cinemablend.com
Microsoft Hints At Cross-Platform Opportunities Between Xbox One And PC - forbes.com