【发布时间】:2017-03-15 18:29:36
【问题描述】:
注意:我已阅读有关如何解决此问题的 stackoverflow 上的其他主题: Creating default object from empty value in PHP?
由于某种原因,我仍然收到警告消息:Creating default object from empty value
我已经尝试了一些方法来修复警告:
$data = new stdClass();
$data->result->complex->first_key = $old_data->result->complex;
也试过了:
$data->result->complex = new stdClass();
$data->result->complex->first_key = $old_data->result->complex;
仍然收到警告:Creating default object from empty value 在上面新 stdClass() 初始化的行号上。
期望的结果: 如何正确初始化新的空对象?
【问题讨论】:
标签: php object warnings php-5.4