     '("\\<\\(function\\)\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*("
       (1 font-lock-keyword-face)
       (2 font-lock-function-name-face nil t))
-    
+
     ;; class hierarchy
     '("\\(self\\|parent\\)\\W" (1 font-lock-constant-face nil nil))
 

   (cons
    (concat "\\<\\(" php-constants "\\)\\>")
    'font-lock-constant-face)
   
   ;; Fontify keywords
   (cons
    (concat "\\<\\(" php-keywords "\\)\\>")
    'font-lock-keyword-face)
   
   ;; Fontify keywords and targets, and case default tags.
   (list "\\<\\(break\\|case\\|continue\\)\\>[ \t]*\\(-?\\(?:\\sw\\|\\s_\\)+\\)?"
	 '(1 font-lock-keyword-face) '(2 font-lock-constant-face t t))

;; [Contributed by Gerrit Riessen]
(defvar php-imenu-generic-expression
 '(
   ("All Functions"
    "^\\s-*function\\s-+\\([[:alnum:]_]+\\)\\s-*(" 1)
   ("Classes"
    "^\\s-*class\\s-+\\([[:alnum:]_]+\\)\\s-*" 1)
   ("Public Methods"
    "^\\s-*public function\\s-+\\([[:alnum:]_]+\\)\\s-*(" 1)
   ("Protected Methods"
    "^\\s-*protected function\\s-+\\([[:alnum:]_]+\\)\\s-*(" 1)
   ("Private Methods"
    "^\\s-*private function\\s-+\\([[:alnum:]_]+\\)\\s-*(" 1)
   )
 "Imenu generic expression for PHP Mode. See `imenu-generic-expression'."
 )

(defconst php-block-stmt-1-kwds '("do" "else" "finally" "try"))
(defconst php-block-stmt-2-kwds
  '("for" "if" "while" "switch" "foreach" "elseif"  "catch all"))

(defconst php-block-stmt-1-key
  (regexp-opt php-block-stmt-1-kwds))
(defconst php-block-stmt-2-key
  (regexp-opt php-block-stmt-2-kwds))

(defconst php-class-decl-kwds '("class" "interface"))

(defconst php-class-key
  (concat
   "\\(" (regexp-opt php-class-decl-kwds) "\\)\\s +"
   c-symbol-key					;; Class name.
   "\\(\\s *extends\\s *" c-symbol-key "\\)?"	;; Name of superclass.
   "\\(\\s *implements *[^{]+{\\)?")) ;; List of any adopted protocols.

;; Create "php-default-face" symbol for GNU Emacs so that both XEmacs
;; and GNU emacs can refer to the default face.
(unless (boundp 'php-default-face)
   (defvar php-default-face 'php-default-face))

;; Create faces for XEmacs
(when (featurep 'xemacs)
  (unless (boundp 'font-lock-keyword-face)
    (copy-face 'bold 'font-lock-keyword-face))
  (unless (boundp 'font-lock-constant-face)
    (copy-face 'font-lock-keyword-face 'font-lock-constant-face)))

(provide 'php-mode)

