--- php-mode.el.orig	2005-08-02 17:31:42.000000000 -0700
+++ php-mode.el	2007-02-03 12:56:56.000000000 -0800
@@ -831,6 +831,10 @@
 	  (beginning-of-line) (end-of-line)
 	  (1 font-lock-constant-face)))
 
+   ;; Fixup autoconstants
+   '("\\(__\\(FILE\\|LINE\\|CLASS\\|FUNCTION\\)__\\)"
+     (1 font-lock-constant-face))
+
    ;; treat 'print' as keyword only when not used like a function name
    '("\\<print\\s-*(" . default)
    '("\\<print\\>" . font-lock-keyword-face)
@@ -852,7 +856,7 @@
    (list
 
     ;; class declaration
-    '("\\<\\(class\\|interface\\)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
+    '("[^_]\\<\\(class\\|interface\\)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
       (1 font-lock-keyword-face) (2 font-lock-type-face nil t))
     ;; handle several words specially, to include following word,
     ;; thereby excluding it from unknown-symbol checks later
@@ -880,6 +884,10 @@
     ;; variable features
     '("^[ \t]*\\(static\\|const\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
       (1 font-lock-keyword-face))
+
+    ;; class constants
+    '("^[ \t]*const\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)"
+      (1 font-lock-constant-face))
     ))
   "Medium level highlighting for PHP mode.")
 
@@ -911,7 +919,7 @@
       1 font-lock-type-face)
 
     ;; PHP5: function declarations may contain classes as parameters type
-    `(,(concat "[(,]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-+\\$\\(?:\\sw\\|\\s_\\)+\\>")
+    `(,(concat "[(,]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-+&?\\$\\(?:\\sw\\|\\s_\\)+\\>")
       1 font-lock-type-face)
 
     ;; Fontify variables and function calls
@@ -922,6 +930,7 @@
     '("->\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face t t)) ; ->variable
     '("->\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" . (1 default t t)) ; ->function_call
     '("\\(?:\\sw\\|\\s_\\)+::\\(?:\\sw\\|\\s_\\)+\\s-*(" . default) ; class::method call
+    '("\\(?:\\sw\\|\\s_\\)+::\\(?:\\sw\\|\\s_\\)+" . font-lock-constant-face) ; class::constant
     '("\\<\\(?:\\sw\\|\\s_\\)+\\s-*[[(]" . default)	; word( or word[
     '("\\<[0-9]+" . default)		; number (also matches word)
 
