mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #11739: Fixed ArrayHelper::index()
losing precision for float keys
This commit is contained in:

committed by
Alexander Makarov

parent
0e3fc540cd
commit
239d7814eb
@ -363,6 +363,9 @@ class BaseArrayHelper
|
||||
} else {
|
||||
$value = static::getValue($element, $key);
|
||||
if ($value !== null) {
|
||||
if (is_float($value)) {
|
||||
$value = (string) $value;
|
||||
}
|
||||
$lastArray[$value] = $element;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user