Certain things have to be perfect for me to be a functional human, and one of them, unfortunately, is the formatting of my code.
Before text editors had automatic indenting and other OCD-friendly coding aids, this was more than a little problematic for my productivity.
That said, it's 2011, and it's still not easy to find the perfect PHP formatter. They tend to either break your code (e.g. phpDesigner's inability to cope with "continue 2" [fixed in version 8]), require the use of a bloated IDE (e.g. Zend Studio), offer an inadequate set of options (e.g. most of the formatters Google knows about) or only work online (hello IP infringement). As an added bonus, there aren't any cross-platform options (except Zend Studio, which I can't stand).
The best solution I've found so far is WaterProof's phpCodeBeautifier. It's PC-only (although they do offer a Linux version, so I'm hoping they'll compile an OS X one eventually), it plays nice with PHP5 (including late static binding), it's fast (especially when wrapped up in a batch script) and it's free!
Here's the batch script I'm using:
@echo off
copy /y %1 %1.phpCB
C:\util\phpCB --space-after-start-bracket --space-before-end-bracket --space-after-if --space-after-switch --space-after-while --space-before-start-angle-bracket --space-after-end-angle-bracket --extra-padding-for-case-statement --one-true-brace-function-declaration --glue-arrow --indent-with-tab --force-large-php-code-tag --force-true-false-null-contant-lowercase --align-equal-statements --optimize-eol --one-true-brace --rewrite-only-documentation-comment --comment-rendering-style PEAR --padding-char-count 1 %1.phpCB > %1
del %1.phpCB
You'll thank me later.