<?php/*class Ren {public static $color;static function Show(){Car::$name;self::$color;} }class Car {public static $name; }*///抽象类 /*abstract class DongWu {public $dong;public $jiao;function Chi(){}function Shui(){} }*///接口关键字:interface //接口里面的方法没有函数体 //实现接口使用的关键字:implements,不使用extends //实现接口的子类必须要实现接口的每个方法//接口 /*interface USB {function Read(); function Write(); } //鼠标 class Mouse implements USB {function Read(){echo "插入了鼠标!";}function Write(){echo "通电给鼠标!";} } //键盘 class JianPan implements USB {function Read(){echo "插入了键盘";}function Write(){echo "通电给键盘";} }$m = new Mouse(); $m->Read(); $m->Write();*//*class Ren {public $name="张三";public $sex;public $age;function Run(){}function show(){echo "name代表姓名,sex代表性别,age代表年龄,Run()方法代表跑的方法";}//析构方法function __destruct(){//在对象销毁之前,将内存释放,连接关闭等等echo "该对象销毁了!";}//在输出对象的时候调用,必须有一个返回值function __tostring(){//return "name代表姓名,sex代表性别,age代表年龄,Run()方法代表跑的方法";return $this->name;}}*/ //写法特殊:__destruct //执行时间特殊:在对象销毁的时候执行/*$r = new Ren();$r->name = "张三";var_dump($r);*//*$r = new Ren();echo $r; *///小知识点 /* $a = 10; $b=3; $c = 25;unset($b);if(!isset($b)) {echo "变量b不存在!";exit; //退出程序die("变量b不存在!"); //输出错误信息并且退出程序 }$sum = $a+$b; echo $sum;echo "<br>";echo $a*$sum; *//*$attr = array(1,2,3,4); $a = "hello";var_dump($attr); print_r($attr); print_r($a);echo "hello","aa"; print "vv"; */?>