有一个class
class i {function a()
{
$this-b();
}function b(){
$this->c();}function c()
{
}}执行a()的时候,b()中的程序可以执行,但是到$this->c();就不能执行了。
但是单独访问b();这个$this->c()是可以执行的。这个是什么问题,如何解决啊
class i {function a()
{
$this-b();
}function b(){
$this->c();}function c()
{
}}执行a()的时候,b()中的程序可以执行,但是到$this->c();就不能执行了。
但是单独访问b();这个$this->c()是可以执行的。这个是什么问题,如何解决啊
function a()
{
$this-b();
}
红色部分错了,应该是$this->b();一下是我的测试结果:class i {
function a(){
echo 'a 已被执行<br>';
$this->b();
}
function b(){
echo 'b 已被执行<br>';
$this->c();
}
function c(){
echo 'c 已被执行<br>';
}}$i = new i();
$i->a();输出为:
a 已被执行
b 已被执行
c 已被执行
会不会因为构造函数之类的问题导致呢?