Write Drupal Code online
There's Simplytest.me, but that's really for testing existing module to see if you like them (e.g. never used Panels before, select Panels from the list and hit Launch Sandbox to give it a go).

You could set up a test site with Devel and hit devel/php.  However this isn't really any different from running a local sandbox site and doing the same thing.

Apart from that, I've not seen anything like what you're looking for.  Sorry :(