Re: ommiting closeing tag in PHP [Re: this is my code i am not getting images throuh php script] [message #176602 is a reply to message #176601] |
Tue, 10 January 2012 21:45 |
M. Strobel
Messages: 386 Registered: December 2011
Karma:
|
Senior Member |
|
|
Am 10.01.2012 22:31, schrieb The Natural Philosopher:
> Richard wrote:
>> The Natural Philosopher <tnp(at)invalid(dot)invalid> 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.
---cut
>>>> >>>>>> /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.
I think of it in terms of HMTL tags <?php ?>
Everything between the tags (including them) is replaced by an
PHP eval of the contents.
> 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.
>
> If the spec says its intrinsic to the language, a feature, it
> can't be a hack can it?
I subscribe to that.
> How many people add semicolons to the last line of a CSS style
> block definition?
/Str.
|
|
|