Is there a PHP Sandbox, something like JSFiddle is to JS?
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/
- http://codepad.viper-7.com/ (defunct)
The most sophisticated is:
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
The system allows full access to all PHP functions - no restrictions and no safe mode. Many common extensions are loaded and available for use. Security is provided on an OS level by strict user permissions inside a setuid chroot jail protected by system call tracing, which should all be transparent to PHP code. You can write files in the /temp folder, but they will be periodically deleted.
The Profile code option will use XDebug to trace every function call in your code and measure the time taken, and will also use VLD to generate a full opcode listing to see how PHP executes your code 'under the hood'!
I personally prefer eXorithm's. Similar to JSFiddle and has custom output formats.
http://c9.io - Not a sandbox but and online IDE that I quite like so far. Supports a LOT more than PHP.
Found this from a Google search,
Add this one to the list: http://sandbox.onlinephpfunctions.com You can choose the php version and save and share your data.
I tried many tools facilitating PHP execution online.
Finally found the Compile Online the best!
This one solved my problem! :-)
来源:https://stackoverflow.com/questions/4616159/is-there-a-php-sandbox-something-like-jsfiddle-is-to-js