diff --git a/lisp/php.el b/lisp/php.el index ffb6cfbf..28fa97f5 100644 --- a/lisp/php.el +++ b/lisp/php.el @@ -223,7 +223,17 @@ it is the character that will terminate the string, or t if the string should be (bound-and-true-p poly-php-html-mode)) (defconst php-beginning-of-defun-regexp - "^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+&?\\(\\(\\sw\\|\\s_\\)+\\)\\s-*(" + (eval-when-compile + (rx bol + (* (syntax whitespace)) + (* (or "abstract" "final" "private" "protected" "public" "static") + (+ (syntax whitespace))) + "function" + (+ (syntax whitespace)) + (? "&" (* (syntax whitespace))) + (group (+ (or (syntax word) (syntax symbol)))) + (* (syntax whitespace)) + "(")) "Regular expression for a PHP function.") (eval-when-compile