eval2: a bigger version of PHP eval()

"eval2" is a debugger / rapid development / prototyping tool, with a built-in MySQL browser

eval2's MySQL browser
New addition in 0.6

That's: a real-time evaluator (debug tool) for PHP, and the Dojo toolkit packed into a single (just one!) mixed binary / ASCII PHP file. Code gets executed server-side as you type and results returned via AJAX. Watch your regular expressions and parsers in action as you type. Comes with a limited textarea code WYSIWYG with tab, shift-tab indentation.


See the screenshots! And the videos page.

Latest addition

A few bugs fixed: detects magic quotes, fires executions only once (onkeypress event removed).

Ability to save code through bookmarks; for example, http://localhost/eval2.php?code=S8sv0lBQyV... (typed code, after gzip, and base64 encoding)

What's so different about eval2?

"eval2" executes PHP code in realtime using ajax and eval(). Entire project fits inside a single PHP file.

  1. eval() exists as a function in PHP but it's underutilized or labeled as a security hazard. My take on it is that it's an invaluable tool for rapid development. I believe that's a unique approach; eval2 is meant to run in a development enviroment only, not live servers.
  2. By processing typed code in a real-time (or near it) AJAX environment, you can watch your code in action and thus assess if it's executing correctly. I think this is a less preferred but possibly more effective method of rapid development or prototyping.
  3. The Dojo toolkit is used as an interface. This provides access to firebug debugging, and various other Dojo enhancements such as its powerful CSS 'query' functionality, et cetera. Secondly, the part of the repackaged toolkit has all of its CSS files, JS files, and graphics packed inside the single PHP file. Lastly, code indentation with tab, shift+tab works in the code editor. That alone is a rare snippet of javascript to find.

In summary, this is a neatly packaged tool that does either little or a lot, depending on a PHP programmer's needs.