1--TEST-- 2SimpleXml: foreach by reference 3--EXTENSIONS-- 4simplexml 5--FILE-- 6<?php 7 8$xml = <<<XML 9<people> 10 <person>Lucy</person> 11 <person>Mikasa</person> 12</people> 13XML; 14 15$people = simplexml_load_string($xml); 16 17foreach ($people as &$person) {} 18 19?> 20--EXPECTF-- 21Fatal error: Uncaught Error: An iterator cannot be used with foreach by reference in %s:%d 22Stack trace: 23#0 {main} 24 thrown in %s on line %d 25