Re: Re: class const versus define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




the define function is to be used on the global scope of your application. This is helpful to assign Configurations Options and other data that you do not will move. For the Class Constants you define the Constant only fo the Class where you are working.
Please read the documentation about this on PHP.NET
http://de.php.net/manual/en/language.oop5.constants.php

Re-read what he said.

What he wants to do is use a previous class constant in another one.

With defines, you can do:

define('VAR_1', 'This is var 1');
define('VAR_2', VAR_1 . ' plus some more on the end');

You cannot do a similar thing with class constants (you get parse errors), he's asking why.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux