Home > Backend Development > PHP Tutorial > 成员属性在两个步骤之间无法共用

成员属性在两个步骤之间无法共用

WBOY
Release: 2016-06-13 12:41:17
Original
863 people have browsed it

成员属性在两个方法之间无法共用

<br />
class a {<br />
    public $a=0;<br />
     public fucntion ax(){<br />
        $this->a='111';<br />
     }<br />
<br />
    public fucntion bx(){<br />
        echo $this->a;<br />
     }<br />
}<br />
Copy after login

$a在ax()中赋值之后,如何才能在bx()中调用值等于111的那个$a?在一个方法中给一个属性赋值之后另一个方法无法获得那个值
PHP

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