2022-09-20 11:54 GMT+02:00, Rowan Tommins <rowan.coll...@gmail.com>: > On 19/09/2022 20:10, Olle Härstedt wrote: >> More for users to learn? Don't you mean less, haha? This is an >> arbitrary limitation of heredoc, that we can remove (it might not be >> arbitrary from a yacc perspective, someone would have to explain that >> if so). > > > I don't think the rules for heredoc are arbitrary, but they are quite > specific: the end delimiter has to appear at the *start* of a line, so > it can appear anywhere else in the text without prematurely ending the > string: > > $foo = <<<FOO > This is a normal heredoc > this is not the end FOO > this is: > FOO;
Ya ok, this kills my idea. If heredoc was designed from start so that the delimiter would not be allowed at all in the text, then it would make sense. Weird that they did it like that, would be easy enough to come up with a unique delimiter so that it would not cause a problem... Obviously it can't be changed now without breaking backwards compatibility. Our product still supports PHP 7.2 sadly, but that's our own problem. :) Thank you. Olle -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php