Why do constants have quotes around when defined and class quoteshave no quotes??

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-11-2007
adam.timberlake@gmail.com
 
Posts: n/a
Default Why do constants have quotes around when defined and class quoteshave no quotes??

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.
Reply With Quote
  #2 (permalink)  
Old 12-13-2007
Olaf Schinkel
 
Posts: n/a
Default Re: Why do constants have quotes around when defined and class quoteshave no quotes??

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:11 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0