|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-20 09:52 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Feb 07 07:00:01 2026 UTC |
Description: ------------ in foreach loop, if i try to use keys as a reference, i'll get "Fatal error: Key element cannot be a reference". my question is why not? can Zend developers add the possibility of key element reference in the sixth PHP version?? Reproduce code: --------------- foreach($arr as &$key => $val) { ... } Expected result: ---------------- change keys inside the foreach loop Actual result: -------------- Fatal error: Key element cannot be a reference