Skip to content

PHP 8.5 not supported? #2451

@NicoAiko

Description

@NicoAiko

With PHP 8.5 the new pipe operator has been introduced.
Unfortunately it seems that prettier/plugin-php isn't able to format correctly and throws an error.

I have PHP 8.5 installed and I don't use composer, just plain old PHP.

2026-01-29T12:14:37+01:00 ERROR [project::lsp_store] Formatting failed: default prettier instance failed to format buffer: SyntaxError: Parse Error : syntax error, unexpected '>' on line 137
  135 |   {
  136 |     return array_map(fn($part) => trim($part, DIRECTORY_SEPARATOR), $parts)
> 137 |       |> fn(array $paths) => implode(DIRECTORY_SEPARATOR, $paths)
      |       ^
  138 |       |> fn(string $path) => preg_replace("#" . DIRECTORY_SEPARATOR . "+#", DIRECTORY_SEPARATOR, $path);
  139 |   }
  140 | }
While handling prettier request: {"jsonrpc":"2.0","id":3,"method":"prettier/format","params":{"text":"..snip..","options":{"plugins":[".../Zed/prettier/node_modules/@prettier/plugin-php/standalone.js"],"parser":"php","filepath":"some filepath","prettierOptions":{"tabWidth":2,"printWidth":100,"useTabs":false,"phpVersion":"auto"},"ignorePath":null}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions