Re: Re: class const versus define

From: Date: Wed, 24 Sep 2008 07:23:29 +0000
Subject: Re: Re: class const versus define
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-280819@lists.php.net to get a copy of this message
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/

« previous php.general (#280819) next »