Question: I installed the ppa:ondrej/php repository for php and performed an apt-get upgrade. Little did I know it had a lot of libraries packages installed that I have no idea about, so I was wondering if they are safe to stay on the system or not?

Answer: 
The PPA is maintained by [Ondřej Surý](https://deb.sury.org/), a Debian developer who has been packaging PHP for Debian since PHP 5. It's up to you whether that fits your own definition of "safe", whatever that is.
Sadly, you'll never know. When using Personal Package Archive (PPA) you're by your own.

There's a post which explains with more detailed caveats :

<https://askubuntu.com/questions/35629/are-ppas-safe-to-add-to-my-system-and-what-are-some-red-flags-to-watch-out-for>