We have already discussed how important it is to test your code. This is true whether you use manual testing or automated testing.
Before you test for logic bugs in your program though, basic syntax errors that will prevent your code from even running need to be checked. While these testing for these errors can be easily done on your own computer, there may be situations wherein you need to compile and run your code via online testing apps/sites. For example, you might be on the go and have to use a public computer where you cannot install a program. So instead of writing the code all in your head, you can just use notepad and check for your code’s accuracy online. It’s like having credit card when you run out of cash!
The good news is that there are several good websites you can use just for that purpose. You can try phpcodechecker, which as the name implies is a free dedicated Php code checker. You can also try Code Run, which can run a good number of different languages including PHP.