Consider the following code:
class MyClass
{
public static $test = 'foo';
public function example()
{
return Self::$test;
}
}
// What I'm trying to do
MyClass->$test = 'bar';
$test = new MyClass();
echo $test->example(); // Should return `bar` instead of `foo`.
Is this or anything remotely close to this possible in PHP?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…