【发布时间】:2016-05-03 14:39:07
【问题描述】:
我有以下代码多年来一直运行良好,但自从我升级到 PHP 5.6.21 后它返回 NULL。
$model = new Model_Status ();
$results = $model->find_all ();
foreach ( $results as $result ) {
echo $result->pk ();
}
当我在运行 PHP 5.6.20 的服务器上回显 $result 时,来自 mysql 的行数据加载到 $_original_values 中,$_primary_key_value 和 $_changed 为空,但在 PHP 5.6.21 中 $_primary_key_value 和 $_original_values 为空,_changed 的值为数据库列
echo Debug::vars($result)
//php 5.6.20
protected _object => array(6) (
"id" => string(1) "1"
"name" => string(4) "Live"
"code" => string(3) "401"
"message" => string(12) "site is live"
"created" => NULL
"modified" => NULL
)
protected _changed => array(0)
protected _original_values => array(6) (
"id" => string(1) "1"
"name" => string(4) "Live"
"code" => string(3) "401"
"message" => string(12) "site is live"
"created" => NULL
"modified" => NULL
)
//php 5.6.21
protected _object => array(6) (
"id" => string(1) "1"
"name" => string(4) "Live"
"code" => string(3) "401"
"message" => string(12) "site is live"
"created" => NULL
"modified" => NULL
)
protected _changed => array(4) (
"id" => string(2) "id"
"name" => string(4) "name"
"code" => string(2) "code"
"message" => string(7) "message"
)
protected _original_values => array(0)
【问题讨论】:
标签: php kohana php-5.6 kohana-orm