php-src/ext/simplexml/tests/foreach_by_reference.phpt
Max Semenik 7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00

24 lines
400 B
PHP

--TEST--
SimpleXml: foreach by reference
--EXTENSIONS--
simplexml
--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