Re: To ?> or not to ?>

From: Date: Tue, 03 Apr 2012 22:37:27 +0000
Subject: Re: To ?> or not to ?>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-317443@lists.php.net to get a copy of this message
I leave them off of any non-view PHP file. It doesn't have any downsides, and leaving them in can cause problems. Just like short tags! Regards, –Josh ____________________________________ Joshua Kehn | @joshkehn http://joshuakehn.com On Apr 3, 2012, at 5:29 PM, Tedd Sperling wrote: > Hi gang: > > Let me start a religious war -- should one end their scripts with "?>" or not? > > After years of never having a problem with ending any of my scripts with "?>", I > found that several students in my class had scripts that did not produce the desired result even > after they were given the scripts via highlight_file(") to cut and paste. > > As it turned out, several students copy/pasted the script with an addition whitespace after the > ending "?>" and as such the scripts did not run as expected. You see, the scripts > created image but apparently the image delivery method objected to the additional whitespace. > > Does anyone have more examples of where scripts will fail IF they end with "?> " > (note the additional space)? > > Cheers, > > tedd > > _____________________ > tedd.sperling@gmail.com > http://sperling.com > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#317443) next »