summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/foreach_by_reference.phpt
blob: 070a3cf2cdb7590de4789efdc3fce48379570efc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
SimpleXml: foreach by reference
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php

$xml = <<<XML
<people>
  <person>Lucy</person>
  <person>Mikasa</person>
</people>
XML;

$people = simplexml_load_string($xml);

foreach ($people as &$person) {}

?>
--EXPECTF--
Fatal error: Uncaught Error: An iterator cannot be used with foreach by reference in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d