Folding should work in almost any language that uses parsers or brackets, so it should work in PHP. I added a few lines as key shortcuts in my .vimrc so that I can automatically add and expand all the definitions of my functions in the file quickly by entering a comma f or F:
" Folding and unfolding map ,f :set foldmethod=indent<cr>zM<cr> map ,F :set foldmethod=manual<cr>zR<cr>
From there, you can expand or redo the levels using z and any fold command that you like. Good tutorial here .
mmrobins
source share