note 71736 deleted from language.oop5.constants by felipe

From: Date: Sat, 15 Dec 2007 02:09:06 +0000
Subject: note 71736 deleted from language.oop5.constants by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133525@lists.php.net to get a copy of this message
Note Submitter: php at blindchaos dot net ---- I was having problems accessing my constants from an extended class in my abstract class, i.e.: abstract class a { public function showConst() { echo self::foo; } } class b extends a { const foo = 'something'; } I found a way to work around this is to switch self::foo with eval("return " . get_class($this) . "::foo;") hope this helps someone.

« previous php.notes (#133525) next »