The syntax coloring definition for PHP in Xcode (as of 4.5.1) is pretty poor:
- probably some 30% of PHP keywords are missing from the definition and are not highlighted as such
- PHP blocks in the middle of HTML tags, also within
<script>and<style>blocks are not recognized - a big drawback for those who code with the short open tags, XCode doesn't support them (
<?and<?=, in fact the latter is enabled irrespective of the short_open_tag setting as of PHP 5.4) - there is a strange glitch with PHP blocks in the form
<?php ...with a single space after the opening tag: the token immediately after the space is not recognized as a PHP token unless you either add one more space or instead insert a new line
I made some modifications to the corresponding xclangspec files (which should be applied after each upgrade to XCode) that solve some of the problems above, but not all. I couldn't make it recognise my PHP insertions within <script> and <style>, plus I couldn't solve the single space glitch problem. Also, for some reason my modifications work slightly better when you mark your PHP files as HTML.
Obviously, short open tags can't be used in XML files, so I didn't even touch the XML syntax definitions, just PHP and HTML.
Anyway, I can post my patches for the xclangfiles if anyone is interested, but I'm also wondering if anyone had any success with doing the same.