How can I transfer music from iPhone to iPhone?

I wanted to transfer music from my 5s to my friend's 4s. But were not able to do it even with some sharing apps. Is there any way to do this?
You can offload the music onto a computer and then transfer the music to your friend's iPhone or use a Wi-Fi/USB type app on both devices.

Original thread: https://forums.imore.com/threads/how-can-i-transfer-music-from-iphone-to-iphone.329127/