<?php
/*
* Created on 2009-10-28
* 分子如梦o(╯□╰)o
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
interface pusb{
function verson();
function type();
}
class mouse implements pusb{
function verson(){
echo "USB 2.0版本;";
}
function type(){
echo "鼠标<br>";
}
}
class video implements pusb{
function verson()
{
echo "USB 1.0版本;";
}
function type(){
echo "视频";
}
}
class myPC{
function output($that){
$that->verson();
$that->type();
}
}
$p = new myPc();
$mouse = new mouse();
$video = new video();
$p->output($mouse);
$p->output($video);
if($p instanceof myPc){
echo "<BR>YES.myPc";
}
?>