【发布时间】:2014-01-13 04:18:37
【问题描述】:
在我问我的问题之前,我想说我搜索了这个问题,其他答案都没有帮助......
基本上,在我的班级DemoClass中,我有4个函数,它们都是“未定义的属性”
我的错误:
注意:未定义的属性:第 46 行 /home/content/92/10270192/html/class.php 中的 DemoClass::$function
注意:第 46 行是我做 $demoClass->function...
我有一个典型的班级设置:
class DemoClass {
public function __construct () {
// stuff that works and gets called
}
public function testFunct () {
// one that is an "undefined property"
}
}
我照常上课:
$testClass = new DemoClass();
var_dump(testClass->testFunct); // this is what is on line 46
// ^^^ This also gives me NULL, because its undefined (? i guess...)
我从来没有遇到过这个问题,有什么建议吗?谢谢!
【问题讨论】:
标签: php function class undefined