我試圖訪問PHP中的父類的內容,但由於某種原因,它似乎並不想通過。我對OOP很陌生,所以如果有任何建議,請告訴我。下面是我的代碼:訪問PHP中的父變量內容
class baseQuery {
public static $numbers = "(1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 32, 39, 50, 52, 72, 109, 110, 850, 1839, 1968, 1969, 1970, 1972, 1973, 2364, 2365, 3009)";
}
class specificQuery extends baseQuery {
public function __construct() {
$numbers = $this->numbers;
}
public function test() {
echo $numbers; //fails
}
}