Add $key to function parameter

I think it's better to enclose `$key` as function parameter.
Update CHANGELOG.md
Log for pull request #3544
Merge pull request #2 from yiisoft/master

merge
Merge pull request #3544 from MDMunir/patch-1

Add $key to function parameter