define() gives you a literal copy of the value of the second parameter. In
this case your second parameter is __LINE__. The value of __LINE__
represents the current line number of the define statement. Once defined the
value assigned remains constant, irrespective of whether or not __LINE__
changes later on. You could 'redefine' the value - but you'd just get the
line number of the redefinition.

You really want a reference (pointer) to the __LINE__ constant, however, you
can't have references to constants. So, you just plain can't do it.

If you think about it, this is a pain only with the parser 'constants', you
wouldn't need a reference to your own constants as they never change.




-----Original Message-----
From: Christian Dechery [mailto:[EMAIL PROTECTED]]
Sent: 28 February 2001 16:13
To: [EMAIL PROTECTED]
Subject: [PHP] redefine constants


why can't I redefine __LINE__?

like define(LN,__LINE__);

it's a rather big constant to put in code to generate my error messages, I
was thinking more of L, or LN... but if I redefine it, it assumes the value
of de redefine() line of code... so it's not really redefining a constant
it's only atributing LN the value of __LINE__...

and in the manual I saw examples where redefining constants were used...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to