开发者

Is it possible to have a variable accessible and modified by different functions of the same class in PHP?

I declare a variable as private in the body of the class and set it to null. After that, I access the variable by a function in the class and initialize it. When I try to rea开发者_JAVA技巧d the value of this variable from another function, it's always null! Did I miss something?


ooooo I did a big mistake. I was accessing the variables like that

$variable

instead of

$this->variable
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜