PHP-Mode 1.5.0 is out

I missed this, but php-mode 1.5.0 is out, and it fixes bugs. Notably, the *-defun method issues which I’ve mentioned before.

I think it’s handling could be improved somewhat. It has all the keywords in the regexp, but doesn’t validate them as it should, so bogus code isn’t flagged as such. This is seemingly valid:

public static final private abstract function foo($bar) {
    return strtolower($bar);
}

I guess it keeps you from declaring your methods as public roastbeef function, though.

Also nice to see is that the long-standing bug with procedural code closing brace indentation is fixed. Basically, in php-mode < 1.5.0, if you had code like:

#! /usr/bin/php
<?php

if ($_SERVER['argc'] == 0) {
    die("Help message");
}

?>

The closing brace of the conditional would be indented two characters in, instead of the start of the line. It’s the sort of bug that I’d experience infrequently enough that I never bothered to track it down.

Emacs 23 users beware: It doesn’t work, bailing with:

Warning (initialization): An error occurred while loading `/Users/ieure/.emacs.d/init.el':

error: `c-lang-defconst' must be used in a file

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

Works fine in Emacs 22. I’ll have to track down what broke when I have more time.

2008/12/28
Previously On Atomized:

Participate