At 8:22 PM -0500 2/19/07, Paul Houle wrote:
Here's a fun fact about <?php that I figured out recently: I always used to write include files like

<?php

...define some functions...
...define some classes...
...set a few global variables ...

?>[EOF]

   where [EOF] is the end of the file.

The trouble was that from time to time, people using certain editors would cause spaces and carriage returns to appear after the ?>. This had the obnoxious effect of opening the output stream and making it possible to send http headers, set cookies and do other important things.

   One day I discovered that I didn't need the "?>"...  I could just write

<?php

... PHP code...
[EOF]

And it works just fine. It scared the people at the office, but they were glad to be rid of a nagging problem.

That has always bothered me. I like symmetrical stuff. I start stuff, I finish stuff.

<start></start>
{
}
()

But, the idea that one purposely leaves something hanging, is


tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com
_______________________________________________
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