Class XX extends blah
{
protected $yyy = array('test', 'test1', 'test2');
}
Ok, so here is the hard part.
I have $classname (currently set to XX)
So:
$classname = 'XX';
How can I get the value of XX's $yyy without creating an object?
Accessing Varible inside a class
Moderator: General Moderators
Re: Accessing Varible inside a class
Code: Select all
$importedYYY = XX::$yyyYou'll need to either make $yyy 'public' or make a function (getYYY() or a magic __get()) to retrieve the value.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.