class test{ private $parameter; public function __construct($parameter){ $this->parameter=$parameter; echo "test类构造方法被调用 "; } public function getParameter(){ echo $this->parameter; // 修改这里 } } class test1{ private static $test=null; public function __construct(){ self::$test = new test("test"); // 修改这里 echo "test1类构造方法被调用 "; } public static function show(){ echo "show()方法被调用"; self::$test->getParameter();// } } $test1 = new test1(); test1::show(); ?>