子クラスの静的メソッドで親(非静的)プロパティにアクセスする際に問題が発生しました。私はこれらを以下のように試しました:
class Parent
{
protected $nonStatic;
// Other methods and properties
}
class Child extends Parent
{
public static function staticFunc()
{
$test = $this->nonStatic; # Using $this when not in object context
$test = self::$nonStatic; # Access to undeclared static property
$test = parent::$nonStatic # Access to undeclared static property
}
}
stackoverflowで同様の質問を確認しましたが、実用的な解決策が得られませんでした
PSタイプミスについて申し訳ありませんが、上記のコードはダミーの例です