Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有问题
class a { public $aa=1; public function dd(){ $this->aa = 2; } public function gg(){ echo $this->aa ; } }
go方法怎么echo $this->aa还是'1'?
echo $this->aa
因为do是 PHP 中的保留关键字。
do
doas 方法名的演示。(一个错误)
Demo 没有do,成功输出 2
您应该将方法名称从更改do为其他名称,因为它是do-while循环中使用的保留关键字。
do-while
因为函数dd()永远不会执行
dd()