diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a05a1..88a5359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 1.4.1 (18. January 2022) + ++ [#15](https://github.com/luyadev/yii-helpers/pull/15) Fix PHP 8.1 compatibility bug in `ArrayHelper::searchColumns()` + ## 1.4.0 (20. October 2022) + [#13](https://github.com/luyadev/yii-helpers/pull/13) Added `Json::decodeSilent()` method which wont throw an exception and returns defined default value instead. @@ -37,4 +41,4 @@ All notable changes to this project will be documented in this file. This projec ## 1.0.0 (2. February 2021) -+ First stable release \ No newline at end of file ++ First stable release diff --git a/src/helpers/ArrayHelper.php b/src/helpers/ArrayHelper.php index 8901a9f..4e5925c 100644 --- a/src/helpers/ArrayHelper.php +++ b/src/helpers/ArrayHelper.php @@ -237,7 +237,7 @@ public static function searchColumn(array $array, $column, $search) public static function searchColumns(array $array, $column, $search) { $keys = array_filter($array, function ($var) use ($column, $search) { - return strcasecmp($search, $var[$column]) == 0 ? true : false; + return strcasecmp($search, (string) $var[$column]) == 0 ? true : false; }); return $keys;