PHP 5.4 Traits

PHP 5.4 adds traits - a means of mixing in behaviors from multiple sources. Think multiple inheritance with some twists to make it manageable.

Check out this example
  http://code.atavisticendeavor.com/using-traits-in-php-54
Or this post showing off some of the sugar:
  http://simas.posterous.com/new-to-php-54-traits

Converting to Symfony image_tag()

Here is a quick and dirty regular expression to convert html img tags to Symfony image_tag() helper calls.  I used it in NetBeans - you can run it in most regexp enabled editors. YMMV.
Search: <img src=”/images/([^”]*)” ([^>]*)>
Replace: <?php echo image_tag(‘$1’,’$2’); ?>