1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/simplexml/tests/bug51615.phpt
Niels Dossche f209eb448e Fix tests for libxml2 2.14
See GH-18009.
2025-03-10 20:22:11 +01:00

36 lines
594 B
PHP

--TEST--
Bug #51615 (PHP crash with wrong HTML in SimpleXML)
--EXTENSIONS--
simplexml
dom
--FILE--
<?php
$dom = new DOMDocument;
$dom->loadHTML('<span title=""y">x</span><span title=""z">x</span>', LIBXML_NOERROR);
$html = simplexml_import_dom($dom);
var_dump($html->body->span);
foreach ($html->body->span as $obj) {
var_dump((string)$obj->title);
}
?>
--EXPECTF--
object(SimpleXMLElement)#%d (3) {
["@attributes"]=>
array(2) {
["title"]=>
string(0) ""
[%r("y"{1,2})%r]=>
string(0) ""
}
[0]=>
string(1) "x"
[1]=>
string(1) "x"
}
string(0) ""
string(0) ""