1

Which GUI applications can execute short PHP snippets directly? Instead of having to create a temporary file and run it on the command-line or in the browser, I'd like to write some code in an editor, click "Run" and see the results directly (preferrably with a dump of all local variables).

I find that the PHP interactive shell is way too basic.

It seems like a very simple application idea, so there should be several small utilities that do this. Do you know of any?

(I'm mostly interested in Linux applications, but feel free to suggest applications on other platforms as well, for other fellow super users.)

1
  • php -e (executes code directly from argument) and var_dump() goes a long way in practice, I find. Typically PHP applications depend on some sort of input in form of request variables. In that case a browser is the most obvious way for output. Since the request must go through the web server, you cannot get a variable dump without specifying this output in the code with var_dump() or similar (massive security hole otherwise). In case you just need to test various functions to see how they respond to simple arguments, php -e is nice. May 7, 2012 at 12:13

2 Answers 2

2

See Seven great PHP IDEs compared, which compares:
Eclipse (PHP IDE Project or PHPEclipse), Komodo, PHP Designer, PhpED, PHPEdit, Zend Studio.

You can run php snippets in vim, if you like : Vim Productivity Tips for PHP Developers, and also VIM as a PHP IDE. Simpler than that and you have the console with "php -a", more complex than that is an IDE.

7
  • can any of them evaluate php snippets?
    – Nifle
    Dec 2, 2010 at 11:55
  • 1
    I can't find the answer to my question at that site, care to elaborate? Dec 2, 2010 at 11:56
  • An IDE can help write, run, debug and publish php files. Isn't this what you are looking for? Snippets must be stored somewhere.
    – harrymc
    Dec 2, 2010 at 12:11
  • Haha, you misunderstood completely. I'm not asking how to develop in PHP, but how to run snippets in something like an interactive console. Please re-read the question. Dec 2, 2010 at 12:30
  • You did ask in your question to be reminded of IDEs. If all you are looking for is a console, just use "php -a".
    – harrymc
    Dec 2, 2010 at 12:38
0

I have created a web console for this: PHP Wonsole.

There is also a Mac OS X utility called Phöpher.

1
  • 11 months ago...
    – Arjan
    Dec 2, 2010 at 12:02

Not the answer you're looking for? Browse other questions tagged .