the error message regarding HEREDOC indentation limit has logically incorrect text.
steps to reproduce:
- navigate to https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
- find the sub-section titled "Closing identifier must not be indented further than any lines of the body"
- find the output of the code from that example - "Parse error: Invalid body indentation level (expecting an indentation level of at least 3) in example.php on line 4"
issue: the error message says that the indentation level must be AT LEAST 3, i.e. "indentation level >= 3".
this contradicts and is completely opposite to the PHP rule (mentioned in the code example title) "Closing identifier must NOT be indented further than any lines of the body"; in this example - "indentation level <= 3".
the code example title contains the correct PHP rule - that the indentation of the closing identifier must NOT be greater than the maximum indentation of the string body.
the error messages from the exception contains wrong and opposite wording.
this error message needs to be fixed both in PHP source-code and in the documentation on that page.
thank you.
the error message regarding HEREDOC indentation limit has logically incorrect text.
steps to reproduce:
issue: the error message says that the indentation level must be AT LEAST 3, i.e. "indentation level >= 3".
this contradicts and is completely opposite to the PHP rule (mentioned in the code example title) "Closing identifier must NOT be indented further than any lines of the body"; in this example - "indentation level <= 3".
the code example title contains the correct PHP rule - that the indentation of the closing identifier must NOT be greater than the maximum indentation of the string body.
the error messages from the exception contains wrong and opposite wording.
this error message needs to be fixed both in PHP source-code and in the documentation on that page.
thank you.