Is there a PHP syntax checker for Notepad++?

前端 未结 6 1149
灰色年华
灰色年华 2021-02-05 01:23

Is there a PHP syntax checker plugin for Notepad++?

Please don\'t answer \"Use another editor instead\"

6条回答
  •  萌比男神i
    2021-02-05 02:08

    PHP can syntax check your file using the -l lint option. Install PHP (if you haven't already) on your computer and use the Run function in Notepad++ and run a command like this:

    cmd.exe /K "C:\Program Files\php-5.6.38-Win32-VC11-x64\php.exe" -l $(FULL_CURRENT_PATH)
    

    Change the path to your install location. After running it via Run you are able to save it, give it a name and assign a custom keyboard shortcut.

    Breakdown of the command:

    • cmd.exe /K open a new Command shell which will stay open after executing
    • "C:\Program Files\php-5.6.38-Win32-VC11-x64\php.exe" launch php.exe
    • -l option of php.exe to use their lint service rather than executing
    • $(FULL_CURRENT_PATH) Notepad++ specific which gives the full path to the current open document

提交回复
热议问题