I use sites like CodePen and JSFiddle all the time to write JavaScript and CSS, but I've not seen a similar site for writing PHP applications. I have used 3v4l.org to test small scripts using different versions of PHP, but it doesn't allow dependencies to be added and doesn't have a nice editing interface.

Recently, I found a site called PHPSandbox that allows users to create PHP applications that can be run in the same way as applications on CodePen. This includes using composer to inject dependencies into the application and a nice little editor interface to see the output and logs from the application.

Read more here: https://www.hashbangcode.com/article/run-php-through-browser-phpsandbox