标签:
<body> <?php class jisuan { private $a; private $b; function __set($d,$e) { if($d=="a") { if($e>0 and $e<100) { $this->$d=$e; } } else if($d="b") { if($e>0 and $e<100) { $this->$d=$e; } } } function __get($d) { return $this->$d; } } $c=new jisuan(); $c->a=10; $c->b=20; echo $he=$c->a+$c->b; echo "<br>"; echo $ji=$c->a*$c->b; ?> </body>
标签:
原文地址:http://www.cnblogs.com/bilibiliganbei/p/5561595.html