This is a discussion on Why do constants have quotes around when defined and class quoteshave no quotes?? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; This is a really basic question for all you people out there who know PHP. This is not a problem ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a really basic question for all you people out there who know
PHP. This is not a problem but just something I'm confused about. I was reading the article below and wondered why are normal constants set with quotes around them, while "class constants" (those little things I learned yesterday from the article) don't have to have quotes around the constants when you define them? It seems really weird to me why PHP would do it this way?? Constants: http://www.talkphp.com/showthread.php?t=1151 Could someome please explain to me the reasons why there are 2 ways to define them - one via a function, and one via, what is it? A language construct? I don't know. The latter having no quotes around to define!! Really weird. |
|
|||
|
adam.timberlake@gmail.com schrieb:
> This is a really basic question for all you people out there who know > PHP. This is not a problem but just something I'm confused about. I > was reading the article below and wondered why are normal constants > set with quotes around them, while "class constants" (those little > things I learned yesterday from the article) don't have to have quotes > around the constants when you define them? It seems really weird to me > why PHP would do it this way?? > > Constants: http://www.talkphp.com/showthread.php?t=1151 > > Could someome please explain to me the reasons why there are 2 ways to > define them - one via a function, and one via, what is it? A language > construct? I don't know. The latter having no quotes around to > define!! Really weird. First, there was the egg...or? The define is older than the class things. And please look at the magic word CONST in the definition. Olaf |