PHP Fatal error: An iterator cannot be used with foreach by reference
-
When trying to rename a bunch of 154 files the wait icon appeared but didn’t work, and got this error in
debug.log
:PHP Fatal error: Uncaught Error: An iterator cannot be used with foreach by reference in D:\domains\www.evitaworks.com\wp-content\plugins\phoenix-media-rename\class-media-rename.php:1279
Tweaked the impeding code as below and it seems to work now:
#alx359--> /* foreach($subj as &$item) { $item = self::replace_media_urls($item, $searches, $replaces); } */// https://stackoverflow.com/questions/29798586/ foreach($subj as $key => $f) { $item = &$subj[$key]; $item = self::replace_media_urls($item, $searches, $replaces); } #<--alx359
Thanks.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘PHP Fatal error: An iterator cannot be used with foreach by reference’ is closed to new replies.