I found three useful ideas in the PHP Developer Best Practices tutorial by Matthew Weier O’Phinney (Zend Technologies, Ltd.), Mike Naberezny (Maintainable Software):
- Add something like PHP_CodeSniffer to pre-commit in Subversion to reject code that doesn’t follow standards
- Run tests in a Subversion post-commit script
- Try to switch to git, because you can also do commits when offline
Sadly, there were also less good ideas like
- Prefix private/protected class methods and properties with an underscore (makes refactoring very difficult; instead you should start with all properties being protected anyway and only make properties public, that need to be public)
- Limit line length to 85 chars (120 chars are ok – nobody uses a 80 char text console for coding anymore – wide screens are standard, even for developers)
- Use PHP_CodeSniffer (I like ZendCodeAnalyzer)
Look at this, if you wanna see bad practices:

Check out these slides by Rasmus Lerdorf presented at FrOSCon 2008:
http://talks.php.net/show/froscon08
Yes, PHP frameworks do suck in terms of performance. CakePHP is the slowest while Zend Framework seems to be the most complex, in terms of include dependencies.
I just found my first bug in Chrome: If you iterate over object properties (using jQuery’s $.each()) and insert HTML generated inside that loop into the DOM, then that HTML appears in random order. Very funny. Might be a problem with threads or Chrome changes the order of object properties by itself:
http://code.google.com/p/chromium/issues/detail?id=223
There was a posting re “Mozilla’s Thought On Google’s Chrome” on Slashdot today… which has a comment that underlines what I wrote earlier:
IMHO, the real target is MS Office. Google makes their money from advertising, which means eyeballs and correlated data. Unfortunately for them, many people spend a majority of their day inside MS Word and MS Excel and other apps. Google would love to have those eyeballs and all that data to better shape their profiles and thus better deliver advertising. What better way than to get all those different apps to “occur” inside the browser?
Google will publish a beta version of it’s own Web browser tomorrow. Sadly, the beta will run on Windows only. Of course, they put some energy in speeding up JavaScript execution as they need this for their own applications. Otherwise they simply won’t be able to provide solutions that can compare with traditional offline applications.
For more information check out the online book about Chrome or the Google Blog.
While visiting the Google Blog, I found out, that a JS warning window appears in Firefox 3, if you hit the back button too fast. You’ll see something like this:
SyntaxError: unterminated string literal
w_xa()@:0
eval("try {\n_WidgetManager._HandleControllerResult('Blog1', 'backlinks',{'numBacklinks': [...]
JSONP seems to be unstable in certain conditions. What makes me wonder is why the browser starts to execute incomplete code and outputs that code in an alert dialog. So, it might as well be the fault of the Google Widgets error handler… but who cares anyway.

I will not only be at the Web 2.0 expo and Barcamp 3 in Berlin but also at the 4th Annual Zend/PHP conference, which will be held on September 15-18, 2008 in Santa Clara, California. That’s in about 2 weeks. Maybe see you there.
