thinkphp 5 stdClass Call to undefined

$User = stdClass();
出现以下错误:
Call to undefined function Home\Controller\stdClass()

 

用 $User = new stdClass(); 
就变成 Class 'Home\Controller\stdClass' not found

回复 ljf : $User = new \stdClass();
注意PHP版本

回复 979137 : $User = new \stdClass();还真可以!这‘\’又是什么意思呢?求解?

回复 ljf : '\' 表示根命名空间

 

来源:http://www.thinkphp.cn/topic/11223.html

相关文章

(1)创建数据表: CREATE TABLE IF NOT EXISTS `think_form` ...
组合查询的主体还是采用数组方式查询,只是加入了一些特殊的...
(1)创建模版:/App/Home/View/Form/edit.html   <FORM m...
自定义配置文件user.php: <?php return array(    \'se...
在一些成熟的CMS系统中,后台一般都包含一个配置中心(如织梦...
废话不多说先上图预览下,即本博客的分页; 这个分页类是在...