Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Hotfix: Changed array_walk to foreach in Zend\Stdlib\Hydrator\ArraySerializable #4259

Closed
wants to merge 1 commit into from

Conversation

tux-rampage
Copy link
Contributor

The data array is manipulated while traversing it. This does not work
with array_walk.

http://www.php.net/manual/en/function.array-walk.php

Only the values of the array may potentially be changed; its structure cannot be altered, i.e., the programmer cannot add, unset or reorder elements. If the callback does not respect this requirement, the behavior of this function is undefined, and unpredictable.

This will fix #4258

The data array is manipulated while traversing it. This does not work
with array_walk.

See PHP documentation:
http://www.php.net/manual/en/function.array-walk.php
Resolves #4258
weierophinney added a commit that referenced this pull request Apr 22, 2013
Hotfix: Changed array_walk to foreach in Zend\Stdlib\Hydrator\ArraySerializable
weierophinney added a commit that referenced this pull request Apr 22, 2013
@ghost ghost assigned weierophinney Apr 22, 2013
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…hotfix/4258

Hotfix: Changed array_walk to foreach in Zend\Stdlib\Hydrator\ArraySerializable
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad use of array_walk in Zend\Stdlib\Hydrator\ArraySerializable
2 participants