Nico's hax0r blog

Dreamweaver CS4 and PHP 5.3 code highlighting.

Dreamweaver CS4 was released in late 2008, when a lot of PHP 5’s functions weren’t available yet (especially PHP 5.3’s stuff). Needless to say, those functions/constants, and language constructs won’t be highlighted properly. But luckily, this is easy to fix.

There’s an XML file located at:

C:\Program Files\Adobe\Adobe Dreamweaver CS4\configuration\CodeColoring\PHP.xml

Or %programfiles%\Adobe\Adobe Dreamweaver CS4\configuration\CodeColoring\PHP.xml

…which holds all keywords, and we can just add our own.

I’ve created my own file with all (or at least most) missing stuff. Including PHP 5.3’s namespaces, new functions, constants etc. I’ve also included the cURL constants which were missing, MySQLi, and what not.

You can download the file here.

Backup your old file, and replace it with the new one. You must restart Dreamweaver after making the changes!

This file works for PC and Mac, by the way.

On a further note, I’ve actually written a PHP script running on PHP 5.3.1 to generate big part of this file. Thanks to get_defined_functions() and get_defined_constants(), I probably didn’t miss a whole lot. If I did, let me know.