码迷,mamicode.com
首页 > 其他好文 > 详细

面向对象

时间:2016-10-07 17:50:31      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

<?php
class human{
      var $name="15";
    var $height;
    var $weight;
    public function eat($food,$name){
        echo $this->name=$name ."s eat ".$food;
    
    }
    public function _construct($height,$weight){
        
    echo    $this->height=$height;
    echo    $this->weight=$height;
        }
}
class nba extends human{
}
$jo=new nba();
 echo $jo->name;
 echo $jo->eat("kafei","lidepeng");
$s=new  human();
$s->_construct("180", "120");

面向对象

标签:

原文地址:http://www.cnblogs.com/lidepeng/p/5936242.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!