This problem is an issue with the PHP.sublime-syntax file in recent Sublime Text 3 builds. As explained in this pull request, there are some things going on behind the scenes when PHP and HTML code mix, especially when HTML is inside of a curly brace block. The PR was accepted, and the current version of the PHP package should now work as expected. To upgrade your installation of ST3, Build 3080 or later (and you really should be using the current Build 3114 of the public beta, or Build 3113 on the dev track), change to a temp directory or someplace and run
git clone https://github.com/sublimehq/Packages.git
or download the zipfile of the repo and expand it. Enter the created Packages directory, then copy the entire PHP folder to Sublime's Packages directory:
- OSX -
~/Library/Application Support/Sublime Text 3/Packages
- Linux -
~/.config/sublime-text-3/Packages
- Windows -
C:\Users\UserName\AppData\Roaming\Sublime Text 3\Packages
- Windows portable install -
InstallationDirectory\Data\Packages
Please keep in mind that this will override (but not overwrite) Sublime's default PHP package, and will not be upgraded when you install a new build, with will almost certainly have additional changes as well. Simply remember to delete the new Packages/PHP directory upon upgrade, and you'll be all set.
sublime-syntaxfiles and wants to submit a PR, please feel free.