I'm not sure if this is a bug or a feature, but it seems you can't
use class constants to set default values for class properties. You
can, however, use them for default values for method params, e.g.:
class foo {}
const BAR = 100;
private $thing = self::BAR;
function wibble($a = self::BAR) {
echo $a;
}
}
In this case $this->thing will be undefined, but wibble() will get
the correct default value for $a.
Comments?
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@xxxxxxxxxxxxxxxxxx | http://www.synchromedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php