Re: [PHP] Has this always been the case?

[email protected] (Stuart Dallas)
Newsgroups php.general
Message-ID <[email protected]>
On 31 May 2013, at 12:17, shiplu <[email protected]> wrote:

> On Fri, May 31, 2013 at 5:12 PM, Stuart Dallas <[email protected]> wrote:
>> That is not entirely correct. It must be a literal value. The expression 'a'.'b' is a constant value.
>> I may be being overly picky here, but I think it's an important distinction.
>> 
> 
> I thought 'a'. 'b' is a constant expression and 'ab' is a constant value. Correct me if I am wrong. 

You're correct that 'a'.'b' is a constant expression, but I wouldn't call 'ab' a constant value, it's a literal [1]. While "constant value" makes logical sense there is a long history of agreed terminology for these things and you will find that using it will enable smoother communication with fellow developers.

Initial values of class constants and member variables must be literals as they are defined not evaluated.

-Stuart

[1] http://en.wikipedia.org/wiki/Literal_(computer_programming)

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.