|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-19 03:04 UTC] laruence@php.net
[2016-04-19 03:04 UTC] laruence@php.net
-Status: Open
+Status: Closed
[2016-07-20 11:32 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
Description: ------------ When we use reference on the object property instead of value in callback function of CallbackFilterIterator we expect that we can change this property value inside of the function, but in php 7 this functionality doesn't work. Test script: --------------- <?php $data = [ [1,2] ]; $callbackTest = new CallbackFilterIterator(new ArrayIterator($data), function (&$current) { $current['message'] = 'Test message'; return true; }); $callbackTest->rewind(); $data = $callbackTest->current(); $callbackTest->next(); var_dump($data); Expected result: ---------------- array(3) { [0]=> int(1) [1]=> int(2) ["message"]=> string(12) "Test message" } Actual result: -------------- array(2) { [0]=> int(1) [1]=> int(2) }