Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!amsnews11.chello.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Date: Tue, 10 Jan 2012 23:02:23 +0100 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.php Subject: Re: ommiting closeing tag in PHP [Re: this is my code i am not getting images throuh php script] References: <31838234.1649.1326122630052.JavaMail.geo-discussion-forums@prak33> <877e0961-7321-44dc-813c-920c855c08c1@j9g2000vby.googlegroups.com> <4f0b14ef$0$6940$e4fe514c@news2.news.xs4all.nl> <9n0r3hFi0lU1@mid.uni-berlin.de> <9n10hbFvhhU1@mid.uni-berlin.de> <9n12f4FgppU1@mid.uni-berlin.de> <9n16qfFifnU1@mid.uni-berlin.de> <9n36ioFs8vU1@mid.uni-berlin.de> <9n3nmsF9a7U1@mid.uni-berlin.de> In-Reply-To: X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID: Lines: 116 NNTP-Posting-Host: 2001:980:9089:1:216:76ff:fee1:aa6c X-Trace: 1326233102 news.xs4all.nl 6982 [2001:980:9089:1:216:76ff:fee1:aa6c]:37790 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4410 On 10-01-2012 22:31, The Natural Philosopher wrote: > Richard wrote: >> The Natural Philosopher writes: >> >>> M. Strobel wrote: >>>> Am 10.01.2012 20:56, schrieb Jerry Stuckle: >>>>> On 1/10/2012 11:16 AM, M. Strobel wrote: >>>>>> Am 10.01.2012 13:54, schrieb Jerry Stuckle: >>>>>>> On 1/10/2012 7:33 AM, The Natural Philosopher wrote: >>>>>>>> Luuk wrote: >>>>>>>>> On 09-01-2012 23:08, M. Strobel wrote: >>>>>>>>>> Am 09.01.2012 23:04, schrieb Luuk: >>>>>>>>>>> On 09-01-2012 21:53, M. Strobel wrote: >>>>>>>>>>>> Just omit the closing tag in php-only files, it's easier >>>>>>>>>>>> than the >>>>>>>>>>>> ob_ functions. >>>>>>>>>>>> >>>>>>>>>>>> /Str. >>>>>>>>>>> If you re-checked, could you also provide us with a link to >>>>>>>>>>> where you >>>>>>>>>>> found that info? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> search string was php closing tag >>>>>>>>>> >>>>>>>>>> http://www.php.net/manual/en/language.basic-syntax.instruction-separation.php >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> /Str. >>>>>>>>> damn, they actually documented this UGLY feature ;) >>>>>>>>> >>>>>>>> Ugly, but damed usefull as my editor has a habit of adding an >>>>>>>> extra >>>>>>>> newline to the end of text files. >>>>>>>> >>>>>>> So get a good editor. >>>>>>> >>>>>> Now why should he "get a good editor" if he can omit the >>>>>> closing tag? >>>>>> >>>>>> /Str. >>>>> Because leaving off the close tag can cause problems later when >>>>> someone else edits the site, assuming close tags are there. >>>>> >>>>> And leaving off a closing tag to get round an editor problem is >>>>> just plain sloppy programming. But we already know certain >>>>> people here don't care about that. >>>>> >>>> He has no editor problem, he can leave the closing tag off. Don't >>>> send him off in a goose chase. >>>> >>>> I knew who would not be comfortable with this easy solution. >>>> >>> Only because >>> >>> (a) he didn't know it >>> and >>> (b) I said it was useful. >>> >>> NOTHING is easier than typing a ?> and then following it with a carriage >>> return.. >> >> How horrible. Are people really suggesting this hard to spot (when you >> dont know it) hack as a way to develop code? Leaving off closing >> tags?!?!? > > > It's not a 'closing tag' : its a switch to tell php to drop back into > 'spit out the source file raw' mode. > it's NOT a switch to tell php to drop back into some other mode... > If you don't ever want it to do that...it seems a valid reasonable and > apparently valid-in-terms-of-the-language-as-specified way to do it. > yes, something is specified > If the spec says its intrinsic to the language, a feature, it can't be > a hack can it? > it's not a hack > How many people add semicolons to the last line of a CSS style block > definition? i recently installed drupal on a (test)system when i do this: cd ....drupal $ grep -lir '?>' * | wc -l 124 $ find * -name "*.php" -type f | wc -l 151 (124 files with (at-least 1) closing tag, 151 files with the extension '.php') and not even all php-files have the '.php' extension..... $ grep -lr '