Is there a PHP Sandbox, something like JSFiddle is to JS?
Asked
Active
Viewed 9.2k times
353
-
16Excellent question for s/o - why on earth was it closed? very strange – Oversteer Aug 15 '12 at 12:35
-
5@Oversteer: It's a shopping question. There is no correct answer, as even if you do manage to compile all current options into an answer, one might disappear tomorrow or another might appear. – Jasper Dec 29 '12 at 05:30
-
30http://phpfiddle.org/ – Fabian Schmengler Feb 13 '13 at 20:53
-
57So, once again, even though this is useful and is actually what I came looking for, it's not constructive. How constructive of you to close it. – CAD bloke Apr 21 '13 at 05:37
-
69why this question is closed?? i found what iam looking for, if it is not 'constructive' i dont know what is. – AgelessEssence May 25 '13 at 13:47
-
70It's absurd how questions like this are considered "non constructive" when they actually give a lot of useful information. I, and others, found exactly what I wanted, and many others will end here (thanks to google). Stackoverflow (and the moderators) really should reevaluate what to be considered as unconstructive. – DiegoDD May 30 '13 at 17:50
-
2codepad.org -several languages supported – WalterV Jan 29 '14 at 04:17
-
It is very useful question and I think iy should be adopted to the tag wiki. I voted to reopen it. – SaidbakR Mar 12 '14 at 23:07
-
2something simple https://chrome.google.com/webstore/detail/servephp/mnpikomdchjhkhbhmbboehfdjkobbfpo – Patrioticcow Feb 03 '15 at 19:30
-
To be honest phpfiddle isn't very "user friendly", codepad.org and codepad.viper-7.com are much better from this point of view. – COil Jul 03 '15 at 21:29
-
@Jasper the same may happen with any programming language. Any future update may break old code. So what? – Rodrigo Feb 08 '17 at 23:39
-
@Rodrigo Yes, it might. No, it probably won't. The difference is that an answer to a question like this needs constant upkeep to stay current (as services do disappear and other services do get off the ground), while the answer you're suggesting doesn't really need much upkeep at all (and if changes are expected, the scope of the question should be restricted to a version of the programming language). Basically, the rule is that time-based questions aren't a good fit for stack overflow, while version based question aren't a problem. (And I didn't make that up, it's the official policy.) – Jasper Feb 09 '17 at 00:02
-
@Jasper The official policy isn't always good or right. Gandhi proved that (probably that's why they never gave him the Peace Nobel). Anyway, at least 261 people disagree with you right now. – Rodrigo Feb 09 '17 at 00:07
-
I also disagree with the reasoning behind closing this question. I’ve found a few good suggestions, though some of them have closed by now, and none of them is a slick as jsFiddle. – Manngo Aug 03 '17 at 07:44
-
I might add that I use a Macintosh, and do a lot of my PHP workout in an application called CodeRunner. It’s good enough to do a lot of simple PHP, JavaScript and HTML development on while still being very light. – Manngo Aug 03 '17 at 07:45
1 Answers
247
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:
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

Florent Roques
- 2,424
- 2
- 20
- 23

Gordon
- 312,688
- 75
- 539
- 559
-
5and if you are just looking for a solution, which let your site users to play around with PHP code, try [Ideone API](http://ideone.com/api/) – kuszi Feb 02 '11 at 20:54
-
73v4l.org - Fantastic suggestion. Also does performance analysis which is a bonus over the majority. – Ne Ma Mar 12 '14 at 13:39
-
1Do any of these have a Save, like jsfiddle? Excepting codepad.org, where Save is available but Run Code erases the program rather than runs it http://i.imgur.com/whw9T2c.png -> http://i.imgur.com/lzsZHUK.png . – ChrisJJ Jan 16 '17 at 14:12
-
2just started using https://implode.io/ - which lets you save and attach a version of the Laravel framework (the only one i could find that lets me do that) – dave Apr 14 '20 at 09:31