您的位置:首页 > 其它

面向对象基础

2017-02-12 17:39 155 查看
<?php
/**
* Created by PhpStorm.
* User: Vvvvv
* Date: 2017/2/11
* Time: 8:36
*/
//$arr = array('x','y','z');

//$x = anshu($a,$b);
//list($a,$b,$c) = $arr;
//$arr[0];
//echo $a;
//echo key($arr);
//echo current($arr);
//next($arr);
//echo key($arr);
//echo current($arr);
class test_class
{
public $abc;//private私有变量    protect受保护的变量
public $a;
public $b;

function square()
{
return $this->a * $this->b;
}
}

$shili = new test_class();
$shili2 = new test_class();

$shili->a = 4;
$shili->b = 5;
$return = $shili->square();
//document.write()
//document->write()

var_dump($shili);
echo "<br>";
var_dump($shili2);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: