<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http:
--><?php
abstract
class
person{
abstract
public
function
speak();
public
$a
;
public
$wq
;
public
function
studywx(
$wx
){
$a
=
new
$wx
;
return
$a
;
}
public
function
usewq(
$wq
){
$a
=
new
$wq
;
return
$wq
;
}
}
class
chperson
extends
person{
public
function
speak(){
echo
"中国人在说话,各路让行!~"
;
}
}
class
amperson
extends
person{
public
function
speak(){
echo
"美国人在说,叽叽喳喳!~"
;
}
}
class
enperson
extends
person{
public
function
speak(){
echo
"英国人在叫,汪汪汪~"
;
}
}
interface
istudy{
public
function
studywx();
public
function
studyyy();
}
class
studyw
implements
istudy{
public
function
studywx(){
echo
"学习武术"
;
}
}
class
studtq
implements
istudy{
public
function
studywx(){
echo
"学习泰拳"
;
}
}
interface
iwq{
public
function
usewq();
}
class
jian
implements
iwq{
public
function
usewq(){
echo
"用剑"
}
}
class
qiang
implements
iwq{
public
function
usewq(){
echo
"用洋枪"
}
}
class
xiaoqiang
implements
iwq{
public
function
usewq(){
echo
"用小米加布枪"
}
}
$chperson
=
new
chperson();
$chperson
->studywx(studtq);
$chperson
->usewq(xiaoqiang);
$chperson
->studywx(studtq);
$amperson
=
new
amperson();
$amperson
->studywx(studyw);
$amperson
->usewq(xiaoqiang);
$amperson
->studywx(qiang);
?>