我正在尝试访问 PHP 中父类的内容,但由于某种原因,它似乎不想通过。我对 OOP 很陌生,所以如果有任何建议,请告诉我。下面是我的代码:
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
}
}