mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fixes #2655: Arrayable and ArrayableTrait are incompatible for some PHP versions.
This commit is contained in:
@ -91,7 +91,11 @@ class BaseJson
|
||||
} elseif ($data instanceof Arrayable) {
|
||||
$data = $data->toArray();
|
||||
} else {
|
||||
$data = get_object_vars($data);
|
||||
$result = [];
|
||||
foreach ($data as $name => $value) {
|
||||
$result[$name] = $value;
|
||||
}
|
||||
$data = $result;
|
||||
}
|
||||
|
||||
if ($data === []) {
|
||||
|
||||
Reference in New Issue
Block a user