newbie question: <?=$variable?> yields no output

newbie question: <?=$variable?> yields no output

am 28.09.2007 20:09:51 von kurt.krueckeberg

I am trying to learn php. Php statements of the form do not
work? If I use instead, it works. I am using php5.
Here is a saample
$var = 5;
?>
var = 10;

The variable $var has a value of:




thanks,
Kurt

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 20:29:55 von sheldonlg

wrote in message
news:1191002991.546795.171650@57g2000hsv.googlegroups.com...
>I am trying to learn php. Php statements of the form do not
> work? If I use instead, it works. I am using php5.
> Here is a saample
> > $var = 5;
> ?>
> var = 10;

> The variable $var has a value of:
>

>
>
> thanks,
> Kurt
>

var = 10;
makes no sense. It should be:
$var = 10;

If you want to have it displayed in the middle of the html area, then say:



echo does that for you. You still need the dollar sign. Also, don't use
short tags. ALWAYS use
Shelly

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 20:31:14 von sheldonlg

Also, NEVER, NEVER, NEVER leave out the semi-colon to end the sentence as
you did below in your next to last code line.

Shelly

wrote in message
news:1191002991.546795.171650@57g2000hsv.googlegroups.com...
>I am trying to learn php. Php statements of the form do not
> work? If I use instead, it works. I am using php5.
> Here is a saample
> > $var = 5;
> ?>
> var = 10;

> The variable $var has a value of:
>

>
>
> thanks,
> Kurt
>

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:18:09 von Jeremy

Shelly wrote:
>
> Also, don't use
> short tags. ALWAYS use >

Why? There is no compelling reason not to use short tags, unless you
love typing.

Also, per your other comment, a closing ?> includes an implicit
semicolon. Whether or not to omit the semicolon in a simple echo
statement: is purely stylistic (I prefer to leave it out in
such a scenario).

People love to bash short tags, but using every
time you want to output a variable in a template makes for unwieldy
template code. PHP has a shorter, more expressive, and semantically
equal method of achieving the same; why not use it?

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:23:32 von zeldorblat

On Sep 28, 2:31 pm, "Shelly" wrote:
> Also, NEVER, NEVER, NEVER leave out the semi-colon to end the sentence as
> you did below in your next to last code line.
>
> Shelly
>
> wrote in message
>
> news:1191002991.546795.171650@57g2000hsv.googlegroups.com...
>
> >I am trying to learn php. Php statements of the form do not
> > work? If I use instead, it works. I am using php5.
> > Here is a saample
> > > > $var = 5;
> > ?>
> > var = 10;

> > The variable $var has a value of:
> >

> >
>
> > thanks,
> > Kurt

Also, NEVER, NEVER, NEVER top-post.

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:23:35 von Macca

> People love to bash short tags, but using every
> time you want to output a variable in a template makes for unwieldy
> template code. PHP has a shorter, more expressive, and semantically
> equal method of achieving the same; why not use it?



Short tags are turned off by default now in up to date installs of
php. This is because the short opening tag file, so the short tag is now deprecated in php in favour of the full


Paul

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:26:06 von Jeremy

macca wrote:
>
>
> because the short opening tag >

Hey, you're right! Good thing PHP code is not an XML file. It's PHP code.

Jeremy

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:35:44 von Macca

>Hey, you're right! Good thing PHP code is not an XML file. It's PHP code.

Why ask a question if you cant handle the answer moron.

Taken directly from the php.ini config file:


; NOTE: Using short tags should be avoided when developing
applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable
code,
; be sure not to use short tags.


Nuff said.

Paul

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:48:52 von Michael Fesser

..oO(Jeremy)

>Why? There is no compelling reason not to use short tags, unless you
>love typing.

Good editors are able to replace ' automatically while typing or by pressing a special hotkey.

>People love to bash short tags

Even the PHP guys recommend to _not_ use them.

>but using every
>time you want to output a variable in a template makes for unwieldy
>template code. PHP has a shorter, more expressive, and semantically
>equal method of achieving the same; why not use it?

Short open tags are unreliable. They can be turned off on the server,
may cause trouble with XML and might be removed entirely in upcoming
versions like all the other old crap (magic quotes, register_globals).
Proper and portable code doesn't rely on them.

Micha

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 21:58:09 von Jeremy

macca wrote:
>
> Why ask a question if you cant handle the answer moron.
>
> Taken directly from the php.ini config file:
>
>

Hey, no need to be a jerk. I was just pointing out that clashing syntax
with XML is not a compelling reason (at least for me) to treat short
tags like they're a register_globals-style abomination. Compiler
directives in C clash with comments in shell scripts; is that a good
reason to stop using them?

> ; NOTE: Using short tags should be avoided *when developing
> applications or
> ; libraries that are meant for redistribution, or deployment on PHP
> ; servers which are not under your control*, because short tags may not
> ; be supported on the target server. For portable, redistributable
> code,
> ; be sure not to use short tags.

(emphasis mine)

Correct translation: There are certain circumstances in which you should
avoid short tags.

Incorrect translation: You should never use short tags, and you should
go around telling everyone else not to use them.

I don't really feel like arguing about it anymore because I have a
feeling you're just going to keep name-calling.

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 22:22:34 von Jeremy

Michael Fesser wrote:
> .oO(Jeremy)
>
> Good editors are able to replace ' > automatically while typing or by pressing a special hotkey.

And in the unlikely event that I have to deploy to a server that doesn't
support short tags and I can't enable them, a sed script can do the
same. In the meantime, I don't have to read and maintain template code
that I consider to be hideous.

Look, I'm not telling YOU to use short tags. I only use them for
templates in the first place. I'm saying it's largely a matter of style
and people shouldn't go around imposing their coding style on others.

> Short open tags are unreliable. They can be turned off on the server,

So can PHP itself.

> may cause trouble with XML

PHP is not XML. If you're referring to XML prologue statements, it is
just as unsafe to assume short tags is off. Putting this in a PHP
source file:



is much more likely to cause a failure on a server over which you have
no control (and which probably has short tags enabled). This leaves the
following option:

'?> (or, if you must,

in which case the short tags problem has already been solved.
Therefore, I contend that "proper, portable code" won't contain any
unescaped XML prologue instructions anyway. So what's the issue?

> might be removed entirely in upcoming versions

If this ever happens, I'll buy you a case of your favorite beer. And
half of the internet will stop working. Pretty doubtful.

> like all the other old crap (magic quotes, register_globals).

These are completely different things that cause real security issues.
You're comparing apples to ravenous crocodiles.

> Proper and portable code doesn't rely on them.

My "improper" code works just fine, but thanks for the sentiment.

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 23:05:18 von Macca

> Incorrect translation: You should never use short tags, and you should
> go around telling everyone else not to use them.


My first first explanation was not a translation of my second post.

My first post gave you a different (all be it correct) reason not to
use short tags whilst, since you were still arguing the point, I gave
you another reason, straight from the php.ini file comments.

And yes...You SHOULD never use short tags (just because you can, for
backwards compatability reasons does not mean you should. IT IS BAD
PRACTICE)

And yes...You SHOULD go around telling everyone else not to use them
also.

P.S - I apologise for being rude, however there is no excuse for being
stubborn about your coding practices. When you are proven wrong,
swallow your pride and change your ways - otherwise you'll be a shite
coder forever.

Regards,

Paul

Re: newbie question: <?=$variable?> yields no output

am 28.09.2007 23:30:45 von Jeremy

macca wrote:
>
>
>> Incorrect translation: You should never use short tags, and you should
>> go around telling everyone else not to use them.
>
>
> My first first explanation was not a translation of my second post.
>
> My first post gave you a different (all be it correct) reason not to
> use short tags whilst, since you were still arguing the point, I gave
> you another reason, straight from the php.ini file comments.
>
> And yes...You SHOULD never use short tags (just because you can, for
> backwards compatability reasons does not mean you should. IT IS BAD
> PRACTICE)

I welcome the discussion, but your argument here is based on the flawed
assumption that short tags are deprecated. They are not. They do not
exist for backward compatibility reasons. They are a feature of the PHP
parser, and they are not on the verge of being removed as everyone seems
to be assuming.

Additionally, as I explained in a reply to someone else, putting
unescaped XML declarations makes your code far less portable than using
short tags. Therefore, there is no compelling reason to disable short
tags on a server, because portable code will not contain anything that
would be broken by enabling it. Therefore, there is no compelling
reason not to use short tags. The "anti-shorttags movement" is based on
logical fallacies.

I'm not arguing that you should use short tags. Do whatever you please.
Your statement below is what bothers me:

> And yes...You SHOULD go around telling everyone else not to use them
> also.

Feel free to voice your opinion about short tags, and why you feel that
way about them. But to suggest that it's *fact* that they aren't to be
used, or are a deprecated "mistake" feature akin to register_globals, is
misleading at best.

> When you are proven wrong,

I haven't been. You making a flawed argument is a far cry from "proving
me wrong."

> swallow your pride and change your ways - otherwise you'll be a shite
> coder forever.

Thanks for implying that I'm a "shite coder," but everyone I have ever
worked with would disagree with you on that point. How I output values
in a PHP template has as little bearing on my coding skill as whether I
put opening braces on the same line or the next line (I do the latter,
because to me it's easier to read).

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 00:23:30 von kurt.krueckeberg

> Short tags are turned off by default now in up to date installs of
> php. This is because the short opening tag > file, so the short tag is now deprecated in php in favour of the full
>
Thanks for the reply. I am using PHP 5.2.0-8. If short tags are turned
off by default (I am using PHP 5.2.0-8), then should this work:






It doesn't. Looks like I need to change all occurances of > to

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 00:31:57 von Jerry Stuckle

Jeremy wrote:
> macca wrote:
>>
>> Why ask a question if you cant handle the answer moron.
>>
>> Taken directly from the php.ini config file:
>>
>>
>
> Hey, no need to be a jerk. I was just pointing out that clashing syntax
> with XML is not a compelling reason (at least for me) to treat short
> tags like they're a register_globals-style abomination. Compiler
> directives in C clash with comments in shell scripts; is that a good
> reason to stop using them?
>
> > ; NOTE: Using short tags should be avoided *when developing
> > applications or
> > ; libraries that are meant for redistribution, or deployment on PHP
> > ; servers which are not under your control*, because short tags may not
> > ; be supported on the target server. For portable, redistributable
> > code,
> > ; be sure not to use short tags.
>
> (emphasis mine)
>
> Correct translation: There are certain circumstances in which you should
> avoid short tags.
>
> Incorrect translation: You should never use short tags, and you should
> go around telling everyone else not to use them.
>
> I don't really feel like arguing about it anymore because I have a
> feeling you're just going to keep name-calling.

PHP is also used to create XML, just like it can be used to create HTML.
And therein lies the problem.

What are you going to do when they take the short tags option away?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 00:34:39 von Jerry Stuckle

Jeremy wrote:
> Michael Fesser wrote:
>> .oO(Jeremy)
>>
>> Good editors are able to replace ' >> automatically while typing or by pressing a special hotkey.
>
> And in the unlikely event that I have to deploy to a server that doesn't
> support short tags and I can't enable them, a sed script can do the
> same. In the meantime, I don't have to read and maintain template code
> that I consider to be hideous.
>
> Look, I'm not telling YOU to use short tags. I only use them for
> templates in the first place. I'm saying it's largely a matter of style
> and people shouldn't go around imposing their coding style on others.
>
>> Short open tags are unreliable. They can be turned off on the server,
>
> So can PHP itself.
>
>> may cause trouble with XML
>
> PHP is not XML. If you're referring to XML prologue statements, it is
> just as unsafe to assume short tags is off. Putting this in a PHP
> source file:
>
>
>
> is much more likely to cause a failure on a server over which you have
> no control (and which probably has short tags enabled). This leaves the
> following option:
>

Not if the server is configured correctly (i.e. short tags off).

> '?> (or, if you must,
>
> in which case the short tags problem has already been solved. Therefore,
> I contend that "proper, portable code" won't contain any unescaped XML
> prologue instructions anyway. So what's the issue?
>

Oh Gawd, what a mess.

>> might be removed entirely in upcoming versions
>
> If this ever happens, I'll buy you a case of your favorite beer. And
> half of the internet will stop working. Pretty doubtful.
>

Plan on it - it's already been announced they will do it. Just a matter
of when.

>> like all the other old crap (magic quotes, register_globals).
>
> These are completely different things that cause real security issues.
> You're comparing apples to ravenous crocodiles.
>

What do you think "deprecated" means?

>> Proper and portable code doesn't rely on them.
>
> My "improper" code works just fine, but thanks for the sentiment.

Fine for you. But you shouldn't be espousing your crap style on others.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 00:45:19 von sheldonlg

Without any name-calling:

Short tags - Sometimes may work and sometimes may not work.
Full tags - Will alway work.

To me, that is reason enough to make using long tags as much of a habit as
maintaining consistent indenting when coding. Therefore, I ALWAYS use long
tags.

Shelly

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 00:46:59 von sheldonlg

wrote in message
news:1191018210.337127.86000@57g2000hsv.googlegroups.com...
>
>> Short tags are turned off by default now in up to date installs of
>> php. This is because the short opening tag >> file, so the short tag is now deprecated in php in favour of the full
>> >
> Thanks for the reply. I am using PHP 5.2.0-8. If short tags are turned
> off by default (I am using PHP 5.2.0-8), then should this work:
>
>
>
>

>
> It doesn't. Looks like I need to change all occurances of >> to
>

Exactly! That is because "=$var" is meaningless.

Shelly

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 00:51:00 von sheldonlg

"Jeremy" wrote in message
news:YodLi.333501$dA7.281625@newsfe16.lga...
> Michael Fesser wrote:
>> .oO(Jeremy)
>>
>> Good editors are able to replace ' >> automatically while typing or by pressing a special hotkey.
>
> And in the unlikely event that I have to deploy to a server that doesn't
> support short tags and I can't enable them, a sed script can do the same.
> In the meantime, I don't have to read and maintain template code that I
> consider to be hideous.
> etc.

I made my living doing consulting and going into places for 6 to 18 month
contracts. The first thing I learned was that if they wanted it coded in a
certain style, I had to change my style. Well, the php community says do it
with long tags. If I were in a hiring position and saw your stubborness as
you have displayed here, guess what the hiring outcome would be.

Shelly

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 01:31:31 von Jeremy

Jerry Stuckle wrote:
>
> Not if the server is configured correctly (i.e. short tags off).

There is nothing inherently correct about turning on short tags.

>
> Oh Gawd, what a mess.
>

Matter of opinion. It also only happens once per document. I would
rather have "a mess" isolated to one line at the top of a document than
a bunch of ugly code throughout.

>>> might be removed entirely in upcoming versions
>
> Plan on it - it's already been announced they will do it. Just a matter
> of when.

This is incorrect information. The topic has been discussed several
times by the community and it has always been decided that short tags
are staying for the reasons I have already discussed. Mainly, that
conflicting syntax with an entirely separate language is no basis for
removing a language feature. PHP is not XML.

PHP can also be used to generate PHP. What do you propose to do about
long tags then? Answer: escape them. Just like XML declarations ought
to be escaped.

>
> What do you think "deprecated" means?
>

It means that a feature has been officially removed from the language or
API, but is left behind for a time while coders adjust to its absence.
Like I said above, this is not the case for short tags. What do you
think it means?

>
> Fine for you. But you shouldn't be espousing your crap style on others.
>

What do you think "espousing" means? I never told anyone to use short
tags, if that's what you (unsuccessfully) tried to say. I'm just
arguing that anti-shorttagists shouldn't be using incorrect information
and logical fallacies to "espouse[sic] their style on others". I won't
accuse your style of being crap, though, because it's not.

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 01:32:33 von Jeremy

Jerry Stuckle wrote:
>
> What are you going to do when they take the short tags option away?
>

*If* they take it away, I'll stop using it.

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 01:36:37 von Jeremy

Shelly wrote:
>
> I made my living doing consulting and going into places for 6 to 18 month
> contracts. The first thing I learned was that if they wanted it coded in a
> certain style, I had to change my style.

Clearly, if a customer or superior wants code a certain way, you are
obligated to conform. This goes for any style rules a company may impose.

> Well, the php community says do it
> with long tags.

OK, but are you employed by the PHP community? It is also awfully bold
to speak for an entire community.

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 03:00:20 von Jerry Stuckle

Jeremy wrote:
> Jerry Stuckle wrote:
>>
>> Not if the server is configured correctly (i.e. short tags off).
>
> There is nothing inherently correct about turning on short tags.
>
>>
>> Oh Gawd, what a mess.
>>
>
> Matter of opinion. It also only happens once per document. I would
> rather have "a mess" isolated to one line at the top of a document than
> a bunch of ugly code throughout.
>

Once per document? So what's wrong with writing of
>>>> might be removed entirely in upcoming versions
>>
>> Plan on it - it's already been announced they will do it. Just a
>> matter of when.
>
> This is incorrect information. The topic has been discussed several
> times by the community and it has always been decided that short tags
> are staying for the reasons I have already discussed. Mainly, that
> conflicting syntax with an entirely separate language is no basis for
> removing a language feature. PHP is not XML.
>

And where do you get your "expert knowledge"? Even the php.ini file
says don't use it. And from what I understand, Zend is going to take it
out - possibly in PHP 6, but no later than PHP 7.

> PHP can also be used to generate PHP. What do you propose to do about
> long tags then? Answer: escape them. Just like XML declarations ought
> to be escaped.
>

Right. And how often do you use it to generate PHP? There are millions
of XML documents out there generated by PHP, however.

>>
>> What do you think "deprecated" means?
>>
>
> It means that a feature has been officially removed from the language or
> API, but is left behind for a time while coders adjust to its absence.
> Like I said above, this is not the case for short tags. What do you
> think it means?
>

No it does not. It means that the feature IS GOING TO BE REMOVED. It
has not been removed yet, to give developers a chance to change their
scripts. But it is going away.

>>
>> Fine for you. But you shouldn't be espousing your crap style on others.
>>
>
> What do you think "espousing" means? I never told anyone to use short
> tags, if that's what you (unsuccessfully) tried to say. I'm just
> arguing that anti-shorttagists shouldn't be using incorrect information
> and logical fallacies to "espouse[sic] their style on others". I won't
> accuse your style of being crap, though, because it's not.

Bullshit. Look back at your posts. And no, my style is not crap. But
yours is.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 03:01:30 von Jerry Stuckle

Jeremy wrote:
> Shelly wrote:
>>
>> I made my living doing consulting and going into places for 6 to 18
>> month contracts. The first thing I learned was that if they wanted it
>> coded in a certain style, I had to change my style.
>
> Clearly, if a customer or superior wants code a certain way, you are
> obligated to conform. This goes for any style rules a company may impose.
>
>> Well, the php community says do it with long tags.
>
> OK, but are you employed by the PHP community? It is also awfully bold
> to speak for an entire community.

The same can be said for you. But in this case, Shelly is in the
majority. You're in the (very small) minority, along with some other
dinosaurs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 13:27:02 von ragearc

I have seen somewhere (can't cite where, as I don't remember the site)
a summary of the PHP 6 discussion, in which only the ASP style tags
are removed. Short Tags will remain enabled and completely
functioning, and they have no plans to remove them.

Might not be completely true, but hey, that's what I just read.

Anyhow, I also never use short tags. Let's call things by their names.

You have them. Clearly tell everyone it's PHP and not XML (or vice versa). When
people assume things in this world of programming, problems happen. It
happened before, and will always happen.

---

Anyway that's not the point. The first post just asked how to do it,
it didn't ask for a lecturing of whether it is correct or not, and as
far as I have seen, the guy is being paid to do it that way.

SO open your php.ini file and check if short tags are enabled. That
code works for me so I can assume it's your server's configuration. Oh
and also, check the file's source code. The PHP might not being
parsed, and being shown as a XML line of code (it did for me yesterday
on another code).

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 15:13:13 von Jerry Stuckle

RageARC wrote:
> I have seen somewhere (can't cite where, as I don't remember the site)
> a summary of the PHP 6 discussion, in which only the ASP style tags
> are removed. Short Tags will remain enabled and completely
> functioning, and they have no plans to remove them.
>

And I've heard just the opposite - that they may be removed in PHP 6.

> Might not be completely true, but hey, that's what I just read.
>
> Anyhow, I also never use short tags. Let's call things by their names.
>
> You have > them. Clearly tell everyone it's PHP and not XML (or vice versa). When
> people assume things in this world of programming, problems happen. It
> happened before, and will always happen.
>
> ---
>
> Anyway that's not the point. The first post just asked how to do it,
> it didn't ask for a lecturing of whether it is correct or not, and as
> far as I have seen, the guy is being paid to do it that way.
>

Encouraging good coding practices IS part of what we should be doing, as
is letting people know what kinds of problems their poor practices can
cause.

It would have dropped quickly if we didn't have a noob who finally
admitted he's too lazy to type
> SO open your php.ini file and check if short tags are enabled. That
> code works for me so I can assume it's your server's configuration. Oh
> and also, check the file's source code. The PHP might not being
> parsed, and being shown as a XML line of code (it did for me yesterday
> on another code).
>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 15:43:54 von ragearc

> And I've heard just the opposite - that they may be removed in PHP 6.

That's just what I read. And I am not for short tags. Although they
might sound appetizing, they reduce the compatibility with other
servers (on which my applications might be used on), and I don't want
that.

> Encouraging good coding practices IS part of what we should be doing, as
> is letting people know what kinds of problems their poor practices can
> cause.
> It would have dropped quickly if we didn't have a noob who finally
> admitted he's too lazy to type
Yes I know but somewhere in the middle of this topic he said he was
hired to code this way so he couldn't use the other way. And I, for
instance, on Zend Studio, when I write

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 20:48:13 von Jerry Stuckle

Bruno Barros wrote:
>> And I've heard just the opposite - that they may be removed in PHP 6.
>
> That's just what I read. And I am not for short tags. Although they
> might sound appetizing, they reduce the compatibility with other
> servers (on which my applications might be used on), and I don't want
> that.
>
>> Encouraging good coding practices IS part of what we should be doing, as
>> is letting people know what kinds of problems their poor practices can
>> cause.
>> It would have dropped quickly if we didn't have a noob who finally
>> admitted he's too lazy to type >
> Yes I know but somewhere in the middle of this topic he said he was
> hired to code this way so he couldn't use the other way. And I, for
> instance, on Zend Studio, when I write >

Actually, no, the original op was not hired to program this way. In
fact, he is new to PHP, and was wondering why doesn't work.

The only one promoting short tags here is Jeremy, and even he didn't say
he was hired to code this way.

It's ok if he does it - he's the only one who will be hurting when he
upgrades and suddenly all of his scripts stop working. But he shouldn't
be promoting bad coding practices on others, especially newbies who
don't know any better.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 29.09.2007 22:33:03 von ragearc

On 29 Sep, 19:48, Jerry Stuckle wrote:
> Bruno Barros wrote:
> >> And I've heard just the opposite - that they may be removed in PHP 6.
>
> > That's just what I read. And I am not for short tags. Although they
> > might sound appetizing, they reduce the compatibility with other
> > servers (on which my applications might be used on), and I don't want
> > that.
>
> >> Encouraging good coding practices IS part of what we should be doing, as
> >> is letting people know what kinds of problems their poor practices can
> >> cause.
> >> It would have dropped quickly if we didn't have a noob who finally
> >> admitted he's too lazy to type >
> > Yes I know but somewhere in the middle of this topic he said he was
> > hired to code this way so he couldn't use the other way. And I, for
> > instance, on Zend Studio, when I write >
> Actually, no, the original op was not hired to program this way. In
> fact, he is new to PHP, and was wondering why doesn't work.
>
> The only one promoting short tags here is Jeremy, and even he didn't say
> he was hired to code this way.
>
> It's ok if he does it - he's the only one who will be hurting when he
> upgrades and suddenly all of his scripts stop working. But he shouldn't
> be promoting bad coding practices on others, especially newbies who
> don't know any better.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Yes, you are right. Jeremy said this:

> Clearly, if a customer or superior wants code a certain way, you are
> obligated to conform. This goes for any style rules a company may impose.

I have mistaken. And the guy who just wanted some help has seen
himself not going anywhere thanks to you guys.

>
>
>

>
> It doesn't. Looks like I need to change all occurances of




Yes, you do have to change, if your short tags are disabled. :S

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 09:36:01 von Macca

>I have mistaken. And the guy who just wanted some help has seen
>himself not going anywhere thanks to you guys.

Thats incorrect, in fact, the first response to the op by Shelly
clearly stated how to fix his problem, while subsequent posts
discussed why.

The only person struggling with the answers in Jerry - Oh well, I
suppose sometimes you just can't teach an old dog new tricks!

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 15:24:12 von Jerry Stuckle

macca wrote:
>> I have mistaken. And the guy who just wanted some help has seen
>> himself not going anywhere thanks to you guys.
>
> Thats incorrect, in fact, the first response to the op by Shelly
> clearly stated how to fix his problem, while subsequent posts
> discussed why.
>
> The only person struggling with the answers in Jerry - Oh well, I
> suppose sometimes you just can't teach an old dog new tricks!
>

Who's struggling with the answers? Just pointing out that even
according to Zend, using short takes is bad? And that I've heard that
it's going away completely in PHP 6 (as others have)? And that everyone
except Jeremy agrees with me?

So who's struggling here? You can't understand simple things like this?
Or are you just a fucking troll?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 15:46:58 von Shelly

"Jerry Stuckle" wrote in message
news:zI-dnYChLr2cOWLbnZ2dnUVZ_r3inZ2d@comcast.com...
> macca wrote:
>>> I have mistaken. And the guy who just wanted some help has seen
>>> himself not going anywhere thanks to you guys.
>>
>> Thats incorrect, in fact, the first response to the op by Shelly
>> clearly stated how to fix his problem, while subsequent posts
>> discussed why.
>>
>> The only person struggling with the answers in Jerry - Oh well, I
>> suppose sometimes you just can't teach an old dog new tricks!
>>
>
> Who's struggling with the answers? Just pointing out that even according
> to Zend, using short takes is bad? And that I've heard that it's going
> away completely in PHP 6 (as others have)? And that everyone except
> Jeremy agrees with me?
>
> So who's struggling here? You can't understand simple things like this?
> Or are you just a fucking troll?

Jerry, please read more carefully! Macca is AGREEING with you, so why are
you resorting to foul adjectives and calling him a troll? BOTH of you are
saying that the ONLY one here advocating short tags is Jeremy!

BTW, what does or even mean? To me it is nonsense.
That is what I wrote


Note, also, that besides ALWAYS using long tags, I also ALWAYS add spaces
for clarity.

Shelly

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 15:52:19 von Jerry Stuckle

Shelly wrote:
> "Jerry Stuckle" wrote in message
> news:zI-dnYChLr2cOWLbnZ2dnUVZ_r3inZ2d@comcast.com...
>> macca wrote:
>>>> I have mistaken. And the guy who just wanted some help has seen
>>>> himself not going anywhere thanks to you guys.
>>> Thats incorrect, in fact, the first response to the op by Shelly
>>> clearly stated how to fix his problem, while subsequent posts
>>> discussed why.
>>>
>>> The only person struggling with the answers in Jerry - Oh well, I
>>> suppose sometimes you just can't teach an old dog new tricks!
>>>
>> Who's struggling with the answers? Just pointing out that even according
>> to Zend, using short takes is bad? And that I've heard that it's going
>> away completely in PHP 6 (as others have)? And that everyone except
>> Jeremy agrees with me?
>>
>> So who's struggling here? You can't understand simple things like this?
>> Or are you just a fucking troll?
>
> Jerry, please read more carefully! Macca is AGREEING with you, so why are
> you resorting to foul adjectives and calling him a troll? BOTH of you are
> saying that the ONLY one here advocating short tags is Jeremy!
>

Yes, Shelly, please read more carefully. Macca said "Jerry" - not "Jeremy".

> BTW, what does or even mean? To me it is nonsense.
> That is what I wrote
>
>
> Note, also, that besides ALWAYS using long tags, I also ALWAYS add spaces
> for clarity.
>
> Shelly
>
>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 16:08:23 von Shelly

"Jerry Stuckle" wrote in message
news:5O6dnUIN5rQKN2LbnZ2dnUVZ_t7inZ2d@comcast.com...
> Shelly wrote:
>> "Jerry Stuckle" wrote in message
>> news:zI-dnYChLr2cOWLbnZ2dnUVZ_r3inZ2d@comcast.com...
>>> macca wrote:
>>>>> I have mistaken. And the guy who just wanted some help has seen
>>>>> himself not going anywhere thanks to you guys.
>>>> Thats incorrect, in fact, the first response to the op by Shelly
>>>> clearly stated how to fix his problem, while subsequent posts
>>>> discussed why.
>>>>
>>>> The only person struggling with the answers in Jerry - Oh well, I
>>>> suppose sometimes you just can't teach an old dog new tricks!
>>>>
>>> Who's struggling with the answers? Just pointing out that even
>>> according to Zend, using short takes is bad? And that I've heard that
>>> it's going away completely in PHP 6 (as others have)? And that everyone
>>> except Jeremy agrees with me?
>>>
>>> So who's struggling here? You can't understand simple things like this?
>>> Or are you just a fucking troll?
>>
>> Jerry, please read more carefully! Macca is AGREEING with you, so why
>> are you resorting to foul adjectives and calling him a troll? BOTH of
>> you are saying that the ONLY one here advocating short tags is Jeremy!
>>
>
> Yes, Shelly, please read more carefully. Macca said "Jerry" - not
> "Jeremy".

Sorry, yes he did. I missed that for the same reason that I always read
"the the" as "the", as most people do. In other words, we read context as
well as the actual words. The context he was using clearly meant Jeremy (as
the only one not bothered by short tags), and not Jerry. I think he merely
mistyped -- and this why I read "Jeremy" and not "Jerry". Technically,
though, you are 100% correct.

Shelly

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 17:17:30 von Jerry Stuckle

Shelly wrote:
> "Jerry Stuckle" wrote in message
> news:5O6dnUIN5rQKN2LbnZ2dnUVZ_t7inZ2d@comcast.com...
>> Shelly wrote:
>>> "Jerry Stuckle" wrote in message
>>> news:zI-dnYChLr2cOWLbnZ2dnUVZ_r3inZ2d@comcast.com...
>>>> macca wrote:
>>>>>> I have mistaken. And the guy who just wanted some help has seen
>>>>>> himself not going anywhere thanks to you guys.
>>>>> Thats incorrect, in fact, the first response to the op by Shelly
>>>>> clearly stated how to fix his problem, while subsequent posts
>>>>> discussed why.
>>>>>
>>>>> The only person struggling with the answers in Jerry - Oh well, I
>>>>> suppose sometimes you just can't teach an old dog new tricks!
>>>>>
>>>> Who's struggling with the answers? Just pointing out that even
>>>> according to Zend, using short takes is bad? And that I've heard that
>>>> it's going away completely in PHP 6 (as others have)? And that everyone
>>>> except Jeremy agrees with me?
>>>>
>>>> So who's struggling here? You can't understand simple things like this?
>>>> Or are you just a fucking troll?
>>> Jerry, please read more carefully! Macca is AGREEING with you, so why
>>> are you resorting to foul adjectives and calling him a troll? BOTH of
>>> you are saying that the ONLY one here advocating short tags is Jeremy!
>>>
>> Yes, Shelly, please read more carefully. Macca said "Jerry" - not
>> "Jeremy".
>
> Sorry, yes he did. I missed that for the same reason that I always read
> "the the" as "the", as most people do. In other words, we read context as
> well as the actual words. The context he was using clearly meant Jeremy (as
> the only one not bothered by short tags), and not Jerry. I think he merely
> mistyped -- and this why I read "Jeremy" and not "Jerry". Technically,
> though, you are 100% correct.
>
> Shelly
>
>


If that is the case, then I *profusely* apologize for my comments.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 20:46:09 von Macca

My fault I'm afraid Jerry,

of course,

I did mean JEREMY...


Regards,

Paul

Re: newbie question: <?=$variable?> yields no output

am 30.09.2007 22:33:11 von Jerry Stuckle

macca wrote:
> My fault I'm afraid Jerry,
>
> of course,
>
> I did mean JEREMY...
>
>
> Regards,
>
> Paul
>
>

OK, Paul. Please accept my sincere apology for what I said.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 01.10.2007 01:02:57 von Macca

No problem, I suppose i should pay more attention when trying to multi-
task ;-)

Re: newbie question: <?=$variable?> yields no output

am 01.10.2007 11:16:25 von NoDude

Short tags are not going away in php 6
http://www.php.net/~derick/meeting-notes.html#remove-support -for-and-script-language-php-and-add-php-var
, semicolons are never mandatory prior to a closing php tag
http://www.php.net/basic-syntax.instruction-separation , short tags
are not deprecated, but are not portable and are not recommended
http://ca.php.net/language.basic-syntax , can we end this now?

Re: newbie question: <?=$variable?> yields no output

am 01.10.2007 13:23:07 von ragearc

On 1 Oct, 10:16, NoDude wrote:
> Short tags are not going away in php 6http://www.php.net/~derick/meeting-notes.html#remove-suppor t-for-and-...
> , semicolons are never mandatory prior to a closing php taghttp://www.php.net/basic-syntax.instruction-separation, short tags
> are not deprecated, but are not portable and are not recommendedhttp://ca.php.net/language.basic-syntax, can we end this now?

Exactly! That's where I found about short tags not going away in PHP
6 ;) Thanks a lot for showing people I was not liar ;).

Re: newbie question: <?=$variable?> yields no output

am 02.10.2007 09:08:43 von Courtney

Shelly wrote:
> Also, NEVER, NEVER, NEVER leave out the semi-colon

I left a semi-colon out in the rain once and it grew into a parenthesis,
and was about to flower and bear exclamation marks when some pedant cut
it down.

Has anybody actually answered the originial query in this thread by the
way?

I know its easier to argue style issues than to actually think, and
debug stuff..but surely..

Re: newbie question: <?=$variable?> yields no output

am 02.10.2007 12:21:20 von Shelly

"The Natural Philosopher" wrote in message
news:1191308930.90169.0@despina.uk.clara.net...
> Shelly wrote:
>> Also, NEVER, NEVER, NEVER leave out the semi-colon
>
> I left a semi-colon out in the rain once and it grew into a parenthesis,
> and was about to flower and bear exclamation marks when some pedant cut it
> down.
>
> Has anybody actually answered the originial query in this thread by the
> way?

I did long ago. I said he had to have "echo".

Shelly

Re: newbie question: <?=$variable?> yields no output

am 02.10.2007 13:17:42 von Jerry Stuckle

NoDude wrote:
> Short tags are not going away in php 6
> http://www.php.net/~derick/meeting-notes.html#remove-support -for-and-script-language-php-and-add-php-var
> , semicolons are never mandatory prior to a closing php tag
> http://www.php.net/basic-syntax.instruction-separation , short tags
> are not deprecated, but are not portable and are not recommended
> http://ca.php.net/language.basic-syntax , can we end this now?
>

Minutes PHP Developers Meeting

Paris, November 11th and 12th, 2005

From a meeting over two years old? Hardly what I would call anywhere
near current information.

But I agree I can't find anything right now that indicates short tags
are deprecated. But just the fact Zend says don't use it in so many
places indicates it probably will be deprecated and removed in the
future, if it hasn't been already.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 02.10.2007 13:18:43 von Jerry Stuckle

Jerry Stuckle wrote:
> NoDude wrote:
>> Short tags are not going away in php 6
>> http://www.php.net/~derick/meeting-notes.html#remove-support -for-and-script-language-php-and-add-php-var
>>
>> , semicolons are never mandatory prior to a closing php tag
>> http://www.php.net/basic-syntax.instruction-separation , short tags
>> are not deprecated, but are not portable and are not recommended
>> http://ca.php.net/language.basic-syntax , can we end this now?
>>
>
> Minutes PHP Developers Meeting
>
> Paris, November 11th and 12th, 2005
>
> From a meeting over two years old? Hardly what I would call anywhere
> near current information.
>
> But I agree I can't find anything right now that indicates short tags
> are deprecated. But just the fact Zend says don't use it in so many
> places indicates it probably will be deprecated and removed in the
> future, if it hasn't been already.
>

That should end "if it hasn't been so designated already".

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: newbie question: <?=$variable?> yields no output

am 03.10.2007 08:42:52 von Janice

Shelly skrev:
> Without any name-calling:
>
> Short tags - Sometimes may work and sometimes may not work.
> Full tags - Will alway work.
>

Or this (which has happened to me):

Short tags - Everything works great day one. Day two the server spits
out PHP source code to everyone visiting the page because the servers
PHP software was upgraded during the night and the "support PHP short
tags" was reset.
Full tags - Will always work

Re: newbie question: <?=$variable?> yields no output

am 03.10.2007 15:09:05 von James Barrett

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

macca wrote:
>
>
>> Incorrect translation: You should never use short tags, and you should
>> go around telling everyone else not to use them.
>
>
> My first first explanation was not a translation of my second post.
>
> My first post gave you a different (all be it correct) reason not to
> use short tags whilst, since you were still arguing the point, I gave
> you another reason, straight from the php.ini file comments.
>
> And yes...You SHOULD never use short tags (just because you can, for
> backwards compatability reasons does not mean you should. IT IS BAD
> PRACTICE)
>
> And yes...You SHOULD go around telling everyone else not to use them
> also.
>
> P.S - I apologise for being rude, however there is no excuse for being
> stubborn about your coding practices. When you are proven wrong,
> swallow your pride and change your ways - otherwise you'll be a shite
> coder forever.
>
> Regards,
>
> Paul
>

It sounds like the kid is getting confused with how these scripts are
processed. Web servers process many different types of files, not just
php. Then he mentions something about C precompile directives. Again, he
is getting confused, because C code is compiled into an executable
binary and will never be processed as a shell interpreter, so the '#' is
never in conflict.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHA5RxQuDJiZ/QrH0RAoHYAJ9pV1OEGiaaXMZdNmj/PVFLEqiavwCe IumR
j7DQdhy49xTgwXLc/jQgsM0=
=hY9B
-----END PGP SIGNATURE-----