Use php-foldexpr.vim for PHP code folding