Skip to content

iteration over ArrayHash with reference#253

Description

@Ciki

Hi @dg, this hotfix breaks iteration over ArrayHash with reference, which is quite unpredictable until one looks into the code..

$hash = \Nette\Utils\ArrayHash::from([1]);
foreach($hash as $k => & $v) {
    $v = 2;
}
dump($hash);

result

Nette\Utils\ArrayHash
0: 1

I don't know if that can be fixed somehow, but at least it could be mentioned in doc for newcomers

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions