Is there a PHP Sandbox, something like JSFiddle is to JS? [closed]

If you are just looking for an online site to play around with PHP code, try

  • http://phpfiddle.org/
  • http://ideone.com/
  • https://codeanywhere.net/
  • http://www.tehplayground.com/
  • http://sandbox.onlinephpfunctions.com/
  • http://codepad.org/
  • https://eval.in/
  • https://implode.io/ (permits attaching a version of the Laravel framework)

The most sophisticated is:

  • http://3v4l.org/

It lets you test your code in all PHP versions starting from PHP4.

If you want something for your local environment, the Runkit extension aims to provide a PHP Sandbox:

Instantiating the Runkit_Sandbox class creates a new thread with its own scope and program stack. Using a set of options passed to the constructor, this environment may be restricted to a subset of what the primary interpreter can do and provide a safer environment for executing user supplied code.

If you dont want to use Runkit but still want a PHP Console on your server, try

  • Jordi Boggiano's Blog - PHP Console in Your Browser
  • http://github.com/seldaek/php-console