问题
Is there a PHP Sandbox, something like JSFiddle is to JS?
回答1:
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:
- 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
回答2:
http://codepad.viper-7.com/
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'!
回答3:
Try:
- http://www.codepad.org
- http://www.ideone.com
回答4:
WriteCodeOnline.com/php/
回答5:
I personally prefer eXorithm's. Similar to JSFiddle and has custom output formats.
http://www.exorithm.com/algorithm/sandbox
回答6:
http://c9.io - Not a sandbox but and online IDE that I quite like so far. Supports a LOT more than PHP.
回答7:
Found this from a Google search,
http://writecodeonline.com/php/
回答8:
Add this one to the list: http://sandbox.onlinephpfunctions.com You can choose the php version and save and share your data.
回答9:
You can try:
http://www.ideone.com
If you are looking for something simple and fast.
回答10:
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