[ClassLoader] fixed heredocs handling

The end of an hereodc must have a newline to avoid PHP syntax errors.
merged branch fabpot/fix-heredocs (PR #7417)

This PR was merged into the 2.2 branch.

Commits
-------

601da45 [ClassLoader] fixed heredocs handling

Discussion
----------

[ClassLoader] fixed heredocs handling

The end of an hereodc must have a newline to avoid PHP syntax errors.