Today I upgraded app-editors/vim (and vim-core / gvim) from app-editors/vim-8.0.0386 to app-editors/vim-8.0.1298, and the syntax highlighting for php is quite broken. When a file is first opened the highlighting tends to work, but if you jump into the middle of the script (for example by searching for text) it stops working. Once that happens it appears you need to go to the top of the file and disable/enable highlighting to get it working.
Once I copied the /usr/share/vim/vim80/syntax/php.vim from version 8.0.0386 to my ~/.vim/syntax directory, it works fine again, so it's clearly an issue with the syntax file itself.
I'm still trying to determine if there's any upstream bug related to this.
I have to amend my first assessment of this: Using the old php.vim doesn't fix this as I originally thought. The behavior is just random enough that it becomes difficult to pin down. I'm going to downgrade back to the older version to ensure that fixes this, but there's clearly more involved than just that syntax file.
This appears to be the issue I'm running into. I've yet to try any of the work-arounds suggested there:
As I noted in that vim bug, increasing the redrawtime from the default 2000 to 10000 actually does correct this. It may just be that the new php syntax file (which I believe adds support for newer php versions) has a little more overhead than the old one. Since that vim bug is closed and this work-around seems to do the trick, I doubt there's any reason to leave this open.