<?php
header("Content-type: text/html; charset=utf-8");
//设置中国时区
date_default_timezone_set('PRC');
interface InterA{
const TITLE="接口接口我爱你!";
//定义一个成员抽象方法
public function showInfo($a,$b);
}
interface InterB{
// const TITLE="php就业班70";
//定义一个静态抽象方法
public static function readMe();
}
class Student implements InterA,InterB
{
//重写showInfo()抽象方法
public function showInfo($name,$age){
echo "{$name}的年龄是{$age}岁!<br>";
}
//重写readMe()抽象方法
public static function readMe(){
echo self::TITLE;
}
}
$stu = new Student();
$stu->showInfo('Mask','56');
$stu->readMe();
![]()