Quite often I have a snippet of PHP code that I’ve quickly typed out, maybe a string builder or something like that, and I need to test it, but I want to test it on its own, without the rest of the script being executed alongside it.
Enter the wonderful world of online PHP interpreters then. Basically these guys allow you to enter some PHP code into a box on a webpage, which then gets evaluated (i.e. executed), and the console result of which is returned to you. Simple.
One of my new favourites in this space is codepad, written by Steven Hazel, and which is billed as being an online compiler/interpreter and a simple collaboration tool.
Usage is as simple as pasting in your code, selecting which language to compile and run it as (and there are a lot to choose from, PHP obviously being one of them), and then hitting the submit button. In addition to returning the result of your executed code (if you so wish), it also provides you with a shortened URL, making it a cinch to share with someone else.
Well worth checking out, especially if you ever need to check that the result of say “strrchr(‘myfilename.txt’,’.’)” is exactly what you were hoping it would be!
Related Link: http://codepad.org/