|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-05-07 02:45 UTC] laruence@php.net
-Assigned To:
+Assigned To: laruence
[2012-05-07 02:57 UTC] laruence@php.net
[2012-05-07 03:03 UTC] laruence@php.net
-Summary: unset array item cause inconsistent array
+Summary: unset array item in array_walk_recursive cause
inconsistent array
[2013-07-29 21:00 UTC] mhitza at gmail dot com
[2016-07-29 22:20 UTC] nikic@php.net
[2016-07-29 22:20 UTC] nikic@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
Description: ------------ when you unset the array which you are iterating. array inconsistent will be reported. I am looking into it, but sadly it is a little difficult to be fixed. since we also allow change the item in the iterator function. thanks Test script: --------------- <?php $arr = array( range(1, 10), range(1, 10), range(1, 10), range(1, 10), range(1, 10), ); array_walk_recursive($arr, function (&$value, $key) use(&$arr) { unset($arr[$key]); }); Expected result: ---------------- nothing wrong Actual result: -------------- Zend/zend_hash.c(1085) : ht=0x25f5b78 is inconsistent