mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
486276f0f9
Closes GH-12229.
27 lines
423 B
PHP
27 lines
423 B
PHP
--TEST--
|
|
GH-12208 (SimpleXML infinite loop when a cast is used inside a foreach)
|
|
--EXTENSIONS--
|
|
simplexml
|
|
--FILE--
|
|
<?php
|
|
|
|
$xml = "<root><a>1</a><a>2</a></root>";
|
|
$xml = simplexml_load_string($xml);
|
|
|
|
$a = $xml->a;
|
|
|
|
foreach ($a as $test) {
|
|
var_dump((string) $a->current());
|
|
var_dump((string) $a);
|
|
var_dump((bool) $a);
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(1) "1"
|
|
string(1) "1"
|
|
bool(true)
|
|
string(1) "2"
|
|
string(1) "1"
|
|
bool(true)
|