Re: [PHP] Override parent class constants

2007-08-26 Thread Richard Lynch
On Wed, August 22, 2007 3:04 pm, James Ausmus wrote: > Hello - I'm trying to find a (sane) way to, in an extended class, > override the parent class's constants, something like the following > (which doesn't actually work): Call me crazy, but if you're over-riding it, then it's not a constant, so

Re: [PHP] Override parent class constants

2007-08-22 Thread Wouter van Vliet / Interpotential
I hate to disappoint you, but there's no real alternative. Same annoyance with get_class() and __CLASS__ always giving you the "class in which the call is defined" instead of the class which is actually being called when dealing with static methods. What you could do is define a protected static m

[PHP] Override parent class constants

2007-08-22 Thread James Ausmus
Hello - I'm trying to find a (sane) way to, in an extended class, override the parent class's constants, something like the following (which doesn't actually work): class baseClass { const myBaseVar = "base value!"; protected $myVar; function __construct() { $this->myVar = self::myBa