   (let ((search-p (or search-p nil))
         (search nil)
         (method-p nil)
-        (constructor-p nil))
+        (constructor-p nil)
+        (back 0))
   (save-excursion
     (while (looking-at "\\sw\\|\\s_")
       (forward-char 1))

(defun php-search-documentation (func)
  "Search PHP documentation for the word at point."
  (interactive (list (read-string "PHP Function: " (current-word t))))
  (browse-url (concat php-search-url func)))

;; Define function for browsing manual

                               (cond
                                 ((or (looking-back "->") (looking-back "::"))
                                  (setq method-p t)
                                  (setq back 2)
                                  (backward-char back))
                                 ((looking-back "new ")
                                  (setq constructor-p t)
                                  (setq back 4)
                                  (backward-char back))
                                 ((looking-back "extends ")
                                  (setq constructor-p t)
                                  (setq back 8)
                                  (backward-char back))))
                             (while (looking-at "\\s'")
                               (forward-char 1))
                             (point))))
               (cond (method-p
                      (setq search (concat "method " (substring search back))))
                     (constructor-p
                      (setq search (concat "constructor " (substring search back)))))
               search)
      nil))))

