Cannot access empty property
程序员文章站
2022-04-18 20:30:39
...
致命错误:不能够进入此空值,位于E:\sunlion\web\down\class\db_sql.php 代码 ?php Class TestClass1{ var $class2; public function TestClass1(){ $this- $class2 = new TestClass2(); } } Class TestClass2{ var $aaaa="1111111"; } $ccc = new TestClas
致命错误:不能够进入此空值,位于E:\sunlion\web\down\class\db_sql.php
代码
Class TestClass1{
var $class2;
public function TestClass1(){
$this-> $class2 = new TestClass2();
}
}
Class TestClass2{
var $aaaa="1111111";
}
$ccc = new TestClass1();
echo $ccc-> $class2-> $aaaa;
?>
错误的地方:
$this-> $class2 = new TestClass2();
改为$this-> class2 = new TestClass2();
$this-> 后的变量不带$符
推荐阅读
-
Cannot access protected property validate $scene
-
MAVEN报错Cannot access alimaven / idea data注解不好使
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object
-
getcwd cannot access parent directories错误解决方法
-
npm ERR! Cannot read property 'path' of null
-
js报错 Cannot read property 'getAttribute' of null
-
[VUE ERROR] Error in render: "TypeError: Cannot create property 'header' on boolean 'true'"
-
微信小程序报Cannot read property 'setData' of undefined的错误
-
webpack报错Cannot read property 'presetToOptions' of undefined
-
Extjs4---Uncaught TypeError: Cannot read property ‘items’ of undefined