-
Notifications
You must be signed in to change notification settings - Fork 2.5k
illegal usage of array_walk in ObjectProperty, ClassMapAutoloader #4296
Conversation
The definition doesn't say anything about not altering the array; it mentions only that changes to the array will not affect the internal pointer of The one case it looks to be problematic is the ObjectProperty hydrator; I'm going to break that into two operations: |
- array_walk() will traverse every pointer in the original input, regardless of modifications to the input, leading to errors. Modified ObjectProperty hydrator to filter keys first, and then extract values.
|
- array_keys() essentially creates a new array, using more memory. It's also like iterating the array twice. - If we're going to iterate once, might as well only do it once.
Fails to merge cleanly to develop... |
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Stdlib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove @Package
That's not unusual; there are a fair number of changes on develop (try merging any view helper changes... (-: ). Should be fairly straightforward to resolve the differences. |
- array_walk() will traverse every pointer in the original input, regardless of modifications to the input, leading to errors. Modified ObjectProperty hydrator to filter keys first, and then extract values.
Per definition of array_walk: http://php.net/manual/en/function.array-walk.php it's not allowed to change the referenced array in the process of array_walk.
e.g. on extraction ObjectProperty does not correctly apply filters. http://pastie.org/7684226