时时商务社区

标题: php警告Creating default object from empty value 问题的解决方法 [打印本页]

作者: 网络通达    时间: 2018-2-14 05:59

            解决方法是找到报错的位置然后看哪个变量是没有初始化而直接使用的,将这个变量先实例化一个空类。如:
[U]复制代码[/U] 代码如下ct = new stdClass();
修改文件相应代码,如:
[U]复制代码[/U] 代码如下:if ( ! isset( $themes[$current_theme] ) ) {
delete_option( 'current_theme' );
$current_theme = get_current_theme();
}
$ct = new stdClass();
$ct->name = $current_theme;
问题解决。
            
            
您可能感兴趣的文章:
  • php in_array 函数使用说明与in_array需要注意的地方说明
  • PHP isset()与empty()的使用区别详解
  • php empty,isset,is_null判断比较(差异与异同)
  • php数组函数序列之in_array() 查找数组值是否存在
  • php empty() 检查一个变量是否为空
  • php数组查找函数in_array()、array_search()、array_key_exists()使用实例
  • ThinkPHP模板判断输出Empty标签用法详解
  • php开发时容易忘记的一些技术细节
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2