ad"/> ad">

php基础-种内部的动态成员变量

WBOY
Release: 2016-06-13 13:11:39
Original
1058 people have browsed it

php基础-类内部的动态成员变量

class TestClass{

????? function TestClass(){

??????????? $this->addAttr = "testtest";

????? }

?

????? function testAddAttr(){

?????????? echo $this->addAttr

???? }

?

}

说明:addAttr我们动态给类对象的一个变量,该变量只能在类内部使用,

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template