php-mode 
- Description
- Major mode for editing PHP code
- Latest
- php-mode-1.28.0.0.20260825.32.tar (.sig), 2026-Aug-25, 950 KiB
- Maintainer
- USAMI Kenta <tadsan@zonu.me>
- Website
- https://github.com/emacs-php/php-mode
- Browse ELPA's repository
- CGit or Gitweb
- Badge
To install this package from Emacs, use package-install or list-packages.
Full description
`php-mode' is a major mode for editing PHP script. Unlike the legacy `php-cc-mode' (kept for backward compatibility in lisp/php-cc-mode.el), this implementation does NOT depend on CC Mode. Indentation is handled by the `syntax-ppss'-based engine in php-indent.el, coding styles by php-style.el, and the PHP vocabulary comes from php-keywords.el. This mode is designed for PHP scripts consisting of a single <?php block. We recommend Web Mode for HTML and Blade templates mixed with PHP. http://web-mode.org/
Old versions
| php-mode-1.26.1.0.20260824.114.tar.lz | 2026-Aug-24 | 127 KiB |
| php-mode-1.26.1.0.20260810.112.tar.lz | 2026-Aug-10 | 126 KiB |
| php-mode-1.26.1.0.20260804.86.tar.lz | 2026-Aug-04 | 114 KiB |
| php-mode-1.26.1.0.20260724.81.tar.lz | 2026-Jul-24 | 112 KiB |
| php-mode-1.26.1.0.20260719.80.tar.lz | 2026-Jul-19 | 112 KiB |
| php-mode-1.26.1.0.20260709.53.tar.lz | 2026-Jul-09 | 98.5 KiB |
| php-mode-1.26.1.0.20251112.64638.tar.lz | 2025-Nov-12 | 97.3 KiB |
| php-mode-1.26.1.0.20241219.164506.tar.lz | 2024-Dec-19 | 96.9 KiB |
| php-mode-1.25.1.0.20240911.185503.tar.lz | 2024-Sep-11 | 95.5 KiB |
| php-mode-1.24.3.0.20230616.191943.tar.lz | 2023-Jun-16 | 101 KiB |
News
Changes for PHP Mode by Version
This file documents notable changes to PHP Mode according to the Keep a Changelog principles.
Unreleased
Added
- Rewrite
php-modeas a CC Mode independent major mode- Indentation is handled by
php-indent.el, asyntax-ppssbased engine ported fromjs.elbundled with GNU Emacs - Coding styles are handled by
php-style.el, a variable-based style system that replaces CC Mode'sc-set-style - PHP language keyword tables are provided by
php-keywords.el
- Indentation is handled by
- Preserve the legacy CC Mode based implementation as
php-cc-mode- This replaces the forward-compatibility alias introduced in 1.28.0 ([#828]) with the real renamed implementation
php-cc-modeis in frozen maintenance: only regression fixes are accepted, and new development happens in the CC Mode independentphp-mode- For backward compatibility,
php-cc-moderunsphp-mode-hookin addition to its ownphp-cc-mode-hook - Settings described in [the CC Mode manual] now apply only to
php-cc-mode; see the commentary at the top oflisp/php-cc-mode.el
Changed
- Change the default of
php-mode-coding-stylefrompeartoper([PER Coding Style 2.0])
Deprecated
c-basic-offsetis obsolete inphp-mode; usephp-indent-offsetinstead- A migration layer still honors a buffer-local
c-basic-offset(for example set via.dir-locals.el) by copying its value intophp-indent-offsetwith a warning
- A migration layer still honors a buffer-local
php-mode-lineup-cascaded-callsis obsolete; usephp-indent-chain-indentinsteadphp-mode-enable-backup-style-variablesis obsolete; usephp-style-delete-trailing-whitespaceinstead
Removed
- Drop support for Emacs 27; PHP Mode now requires Emacs 28.1 or later ([#811])
- Remove the
symfony2coding style fromphp-mode, which is superseded byper- The style remains available in
php-cc-mode php-enable-symfony2-coding-styleis now an obsolete alias forphp-enable-per-coding-style
- The style remains available in
[1.28.0] - 2026-08-25
Added
- Add
php-phpdbg-disassemble-fileandphp-parse-filecommands ([#804]) - Select an HTML template major mode for PHP files that contain HTML and add per-project control through
php-project-php-file-as-template([#742]) - Include
php-align.elandphp-flymake.elin the package ([#820]) - Add a
php-pipe-opface for PHP 8.5's pipe operator ([#821]) - Add
php-ide-set-feature,php-ide-status, andphp-ide-eglot-activatecommands ([#826]) - Add
phpantomandphp-lsppresets tophp-ide-lsp-command-alist([#830]) - Add
php-cc-modeas a forward-compatible alias for the CC Mode basedphp-mode([#828])
Changed
- Add
readonlyclass modifier to [Imenu] ([#802]) - Add
enumsupport tophp-current-class([#802]) - Remove hardcoding of implicit paths in
phpthat are not guaranteed to exist ([#803]) - Make
php-mode-maybehonormajor-mode-remap-alist([#816]) - Let
php-project-get-root-diruseproject.elbackends after PHP-specific markers ([#823]) - Make
php-ide-featuresaccept a bare feature symbol and makephp-ide-turn-ona no-op when no features are configured ([#826]) - Restrict safe directory-local PHP-IDE values and mark command and function alists as risky ([#826])
- Warn about multiple active LSP clients and make PHP-IDE server and mode alists customizable ([#827])
Fixed
- Fix array alignment when an empty line is present ([#801])
- Fix compatibility with upcoming Emacs 32 ([#809])
- Fix PHP function completion sorting, module filtering, and directory-local validation ([#825])
- Fix PHP-IDE feature activation, deactivation, repeated enabling, and Phpactor hover cleanup ([#826], [#827])
- Return a valid
project.elrepresentation fromphp-project-project-find-function([#823]) - Fall back to an HTML mode for Blade templates when
web-modeis unavailable ([#817]) ... ...