php注意问题
时间:2010-11-12 来源:liushan
代码
<?php
class a{
public function c($id){
echo $id;
}
}
class b extends a{
public function c($id,$ic){
parent::c($id);
echo $ic;
}
}
$b=new b();
$b->c(1,2);
/*interface d{
public function e($id);
}
class f implements d{
public function e($id,$ic){//这里错误
}
}
$d=new d();
$d->e(1,2);*/
/*abstract class g{
public abstract function h($id);
}
class i extends g{
public function h($id,$ic){//错误
}
}
$i= new i();
$i->h(1,2);*/
class a{
public function c($id){
echo $id;
}
}
class b extends a{
public function c($id,$ic){
parent::c($id);
echo $ic;
}
}
$b=new b();
$b->c(1,2);
/*interface d{
public function e($id);
}
class f implements d{
public function e($id,$ic){//这里错误
}
}
$d=new d();
$d->e(1,2);*/
/*abstract class g{
public abstract function h($id);
}
class i extends g{
public function h($id,$ic){//错误
}
}
$i= new i();
$i->h(1,2);*/
相关阅读 更多 +