Actions
Bug #20474
closedHeredoc common leading whitespace calculation question
Description
I think I understand that <<~ will strip common leading whitespace from all lines. However, I am confused by the following example:
eval("<<~H\n \nh\n \nH\n")
In this example, the heredoc has 3 lines: " \n", "h\n", and " \n". The common leading whitespace is definitely 0, because of the 2nd line.
However, the string is equal to "\nh\n\n"
. In fact, no matter how many spaces you put before the h
, it will always be equal to "\nh\n\n"
.
I'm not sure if this is a bug, or even what is happening here. Could someone explain?
Actions
Like0
Like0Like0Like0Like0