When you want to test a PHP code snippet quickly, it's handy to do it within your day-to-day environment. For me, this environment is Emacs. The geben package for Emacs provides an interface to the DBGp protocol, such as used by Derick Rethans's standard Xdebug extension for PHP. With the combination of geben and Xdebug, I can quickly and efficiently step through execution of local files, examining code flow and data values.

He includes a ten step process (step 11 is basically "use it") that walks you through the installation of the full stack - PHP, Xdebug and geben - and the configuration changes you'll need to make to get them all working together. Some basic usage instructions are included, but if you want more details on using geben, check out the project's site.

In a new post to his site Christian Weiske shares an update he contributed to the PHP_CodeSniffer functionality to make working with and checking the validity of local PHP code easier - a notifier for PHP_CodeSniffer using the "notify-send" commonly installed in most Linux distributions.

I use emacs as IDE, and wanted to have direct feedback about the validity of my .php files when writing them. The most easy way was to add a save hook that runs PHP_CodeSniffer - but the results should be displayed in a nice, unobtrusive way. phpcs has multiple reporting modes - xml, checkstyle, csv etc. - but nothing for the desktop. I thought that notify-send would be the right fit since it is able to display pretty popup messages without getting in the way.

He also includes the details on his original objective - including it in a "on save" hook as well as providing it in a keystroke shortcut, making checking his code even easier.

On the PHPFreak.de blog there's a new post talking about the author's quest to find the "holy development environment", the one that would make a developer most productive and give them the best features to do their work.

Over the last 8 years I've tried out a lot of different setups. I've always loved Emacs, and for many years my setup was very basic: Linux/FreeBSD desktop, Fluxbox, Xterm, Emacs and Firefox - simple and powerful, and I loved it but I want more. I want my environment to be a bit smarter and not just provide me with some (very, very nice) shortcuts for navigating my code.

He looks at a few other tools and how they compare to what he's used to - VIM, NetBeans, Eclipse PDT - and decides that there's not a clear winner between them and that really, it boils down to two things: what your preference is and what quirks you can deal with on a daily basis.

Roberto Aloi has put together a tool for Emacs that allows you to directly browse the PHP documentation without hopping out of the editor.

php-mode is a set of tools to increase productivity in Emacs when programming PHP. It can be used in conjunction with any other pre-existing PHP mode for Emacs.

You can see an example of it in action in this screenshot and can install it via the five or six steps included in the page (that include downloading the latest "many HTML files" option from the PHP.net documentation page).

On the local.ch blog today, there's this new post (from Philipp Kelle) showing how to, with the help of geben, easily debug your applications from emacs.

While PHP-developing it sometimes is just too tedious to do those 'add a echo here and there, then reload and search the echoed strings on the screen'-loops. So I searched for a debugger for my favourite editor emacs. After a lengthy install procedure I finally got it running: With geben on emacs you can debug PHP (step through and evaluate expressions).

The post steps you through the installation - adding in xdebug, changing the PHP configuration, and getting and installing geben (along with other required packages).

Troels Knak-Nielsen has posted a script that he's developed (for use in Emacs) to look through a PHP file and pull out all of the classes and functions found inside.

As you probably know, PHP has a ridiculous amount of functions for all kinds of things, and as it happens, token_get_all gives access to the Zend Engine tokenizer. In other words, the same chunk of code, which PHP itself uses, when reading a .php file. This provides an excellent base for writing a script, which can parse the socks off ctags.

The emacs file to bind the editor and the PHP script together is also included, making it as simple to use as binding the function key of your choice to the "php-tokens" script.