hp警告Creating default object from empty value 问题的解决方法

本文介绍了解决HP警告中“Creatingdefaultobjectfromemptyvalue”问题的方法。主要通过检查未初始化直接使用的变量并对其进行实例化来解决。例如,在PHP中可以使用new stdClass()来实例化一个空对象。

hp警告Creating default object from empty value 问题的解决方法

解决方法是找到报错的位置然后看哪个变量是没有初始化而直接使用的,将这个变量先实例化一个空类。如:

复制代码 代码如下:
$ct = new stdClass();

修改文件相应代码,如:
复制代码 代码如下:
if ( ! isset( $themes[$current_theme] ) ) {
 delete_option( 'current_theme' );
 $current_theme = get_current_theme();
}
$ct = new stdClass(); <!--添加这行-->
$ct->name = $current_theme;
Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 422 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 449 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 477 Notice: Undefined property: stdClass::$results in E:\xmapp\htdocs\testlink\config.inc.php on line 697 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 741 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 769 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 849 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 856 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 944 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 967 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1191 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1286 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1347 Notice: Undefined property: stdClass::$testCaseStatus in E:\xmapp\htdocs\testlink\config.inc.php on line 1511 Notice: Undefined property: stdClass::$testCaseStatus in E:\xmapp\htdocs\testlink\config.inc.php on line 1512 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1511 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1531 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1560 Warning: Creating default object from empty value in E:\xmapp\htdocs\testlink\config.inc.php on line 1673 Notice: Undefined property: stdClass::$force_https in E:\xmapp\htdocs\testlink\config.inc.php on line 1704 Notice: Undefined property: stdClass::$results in E:\xmapp\htdocs\testlink\config.inc.php on line 1715 Notice: Undefined property: stdClass::$locales in E:\xmapp\htdocs\testlink\config.inc.php on line 1736 Warning: array_key_exists() expects parameter 2 to be array, null given in E:\xmapp\htdocs\testlink\config.inc.php on line 1736 Notice: Undefined property: stdClass::$default_language in E:\xmapp\htdocs\testlink\config.inc.php on line 1741 Notice: Undefined property: stdClass::$results in E:\xmapp\htdocs\testlink\config.inc.php on line 1749 Warning: array_flip() expects parameter 1 to be array, null given in E:\xmapp\htdocs\testlink\config.inc.php on line 1749 Notice: Undefined property: stdClass::$charset in E:\xmapp\htdocs\testlink\config.inc.php on line 1760 Notice: Undefined property: stdClass::$charset in E:\xmapp\htdocs\testlink\config.inc.php on line 1799 Notice: Undefined property: stdClass::$gui_title_separator_1 in E:\xmapp\htdocs\testlink\config.inc.php on line 1800 Notice: Undefined property: stdClass::$gui_title_separator_2 in E:\xmapp\htdocs\testlink\config.inc.php on line 1801 Notice: Undefined property: stdClass::$gui_title_separator_2 in E:\xmapp\htdocs\testlink\config.inc.php on line 1802 Notice: Undefined property: stdClass::$gui_title_separator_1 in E:\xmapp\htdocs\testlink\config.inc.php on line 1806 Notice: Undefined property: stdClass::$gui_title_separator_2 in E:\xmapp\htdocs\testlink\config.inc.php on line 1807 Notice: Undefined property: stdClass::$gui_separator_open in E:\xmapp\htdocs\testlink\config.inc.php on line 1808 Notice: Undefined property: stdClass::$gui_separator_close in E:\xmapp\htdocs\testlink\config.inc.php on line 1809
最新发布
08-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微笑点燃希望

你的鼓励是我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值