為什么提示運行成功,輸出錯誤
<?php
class Car{
? ? function _construct(){
? ? ? ? print "構造函數";
? ? }
? ? function _destruct(){
? ? ? ? print "析構函數";
? ? }
}
class Bus extends Car{
? ? function _construct(){
? ? ? ? print "子類構造";
? ? ? ? parent::_construct();
? ? }
}
$car =new Car();
$bus =new Bus();
2018-12-18
因為你的代碼并沒有跟課程設定的去走所以才會輸出錯誤
2018-11-26
我試了一下,并沒有錯誤