I have downloaded php.vim file, which contains PHP-based syntax information. It should be able to provide syntax based folding, but I can't make it work for some reason.
I have set :let g:php_folding 2
and :set foldmethod=syntax
but for no avail. I'm pretty sure the file is in right place and is read by vim, since I can do :let g:php_sql_query=1
which works.
The php.vim
file is located in ~/.vim/syntax/php.vim
Apparently my VIM didn't run :syntax enable.
Doing :syntax enable fixed the problem, but I also added :syntax on to .vimrc