I get "Function provided is already compiled" in minibuffer whenever I enter php-mode. Why and how to fix it?

Debian bookworm, Emacs 28.2, php-mode 1.24.2.


This is the backtrace @phils asked:

Debugger entered--Lisp error: "Function provided is already compiled"
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_50>(#f(compiled-function (start end) #<bytecode -0x1dc527c4$
  byte-compile(#f(compiled-function (start end) #<bytecode -0x1dc527c4196f2b60>))
  byte-code("\300\301\302\303!\"\207" [defalias php-syntax-propertize-function byte-compile #f(compiled-function (start$
  command-execute(php-mode record)
  execute-extended-command(nil "php-mode" "php-mode")
  funcall-interactively(execute-extended-command nil "php-mode" "php-mode")

1 Answer 1


That message comes from byte-compile, so it sounds like something is attempting to byte-compile a byte-code elisp function.

(defun byte-compile (form)
  "If FORM is a symbol, byte-compile its function definition.
If FORM is a lambda or a macro, byte-compile it as a function."
    (let* ((lexical-binding lexical-binding)
           (fun (if (symbolp form)
                    (symbol-function form)
           (macro (eq (car-safe fun) 'macro)))
      (if macro
          (setq fun (cdr fun)))
           ;; Up until Emacs-24.1, byte-compile silently did nothing
           ;; when asked to compile something invalid.  So let's tone
           ;; down the complaint from an error to a simple message for
           ;; the known case where signaling an error causes problems.
           ((compiled-function-p fun)
            (message "Function %s is already compiled"
                     (if (symbolp form) form "provided"))

Try the following to obtain a backtrace to add to your question:

(setq debug-on-message "Function .+ is already compiled")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.