>>>>print nl2br(
>>>><<<EOD
>>>>Here
>>>>are
>>>>four
>>>>lines.
>>>>EOD
>>>>);
>>>Doesn't the closing EOD need a trailing ";"?
>>
>>The closing parenthesis apparently takes care of the statement
>>closure. Actually, I believe adding one will throw an error.
>
>You are absolutely correct. I don't understand why however
>:-) The here doc structure is
>a parameter for the function nl2br and as such I would think should
>be self containing.

The heredoc structure is self containing.  It is no different than saying 1 + 2 or $a . $b.  Heredocs typically end in semicolons because there are the entirety of the statement.

Think of it outside the context of a heredoc.  The statement print nl2br ($some_variable); only includes a ; at the end.  The same with print nl2br (trim ($some_variable));.  By itself trim ($some_variable) would require a ;, but when used as a parameter to a function, using one would throw an error.

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to