Describe the bug
Mixed indent characters in heredoc makes its content marked as error.
To Reproduce
$mixed_indent_heredoc = <<<EOT
marked
↑ (space)
EOT;
$correct_indent_heredoc = <<<EOT
not
marked
EOT;
$mixed_indent_string = "
not
marked
";
$correct_indent_string = "
not
marked
";
Observed behavior
Content of $mixed_indent_heredoc variable is marked as error by red squiggly underline and Invalid indentation. Mixed spaces and tabs are not allowed.intelephense(1028) message. Other content is not marked.
Expected behavior
No errors reported, presumably.
Screenshots

Platform and version
Win 10, Intelephense 1.4.0 and 1.4.1, not present in 1.3.11.
TIL where the intention is coming from. More examples where it marks properly and where improperly. (I must confess I wasn't aware of most of those truly wrong cases.)
echo "<xmp>";
echo <<<EOT
← tab + space in ↓ tab-indented = OK, but marked as error
EOT;
echo <<<EOT
← spaces + tab in ↓ space indented = OK, but marked as error
EOT;
echo <<<EOT
← space + tab in ↓ tab indented = Parse error: Invalid indentation - tabs and spaces cannot be mixed - marked correctly as error
EOT;
echo <<<EOT
tabs everywhere= OK
EOT;
echo <<<EOT
←nothing in ↓ tab = Parse error: Invalid body indentation level (expecting an indentation level of at least 1) - marked correctly as error
EOT;
echo "</xmp>";
Tabs should work in heredoc, and PHP does allow them. I have not seen this problem before, so maybe this is something that happened recently?
I did not even realize I had tabs in my heredocs, it must be an older editor that inserted them. I really prefer spaces. I will probably just do a search/replace to get those tab characters out of my way.
@jacobkri As I understand it from testing and texts scattered around interwebs [0] (surprisingly I don't see it mentioned in official docs [1]), it's the indent you use before closing heredoc/nowdoc identifier that is expected to be present on start of every single line of preceding content and must consist of tabs or spaces exclusively. This indent chunk is then stripped from the resulting value. Whitespace that follows does not matter and makes it into resulting string verbatim, so you can have e.g. space-indented content of XML string in tab-indented PHP script if you want. (That's how I discovered this Intelephense issue). I think it is very nice and clever, but quite apparently quite a new addition to PHP.
[0] https://stackoverflow.com/a/51165453/540955 pointing to RFC https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes#closing_marker_indentation telling that it is available since php 7.3 (released 6 December 2018 according Google). That RFC reads
The indentation of the closing marker dictates the amount of whitespace to strip from each line within the heredoc/nowdoc.
[1] it even warns that "[the identifier] may not be indented" https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
Is it possible to disable via a setting parameter? This conflicts with indentation rules at my company and renders heredocs illegible.
@ppillot if you could do without features introduced since v1.4.0 you can downgrade back to v1.3.11 in the meantime: open Extensions sidebar, locate Intelephense, click cog, choose "Install another version…" and pick something before 1.4.0
Fig.

@myfonj thanks for the detailed instructions! That helped a lot.