1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Files
archived-php-src/ext/dom/tests/bug45251.phpt
T
Max Semenik bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00

31 lines
486 B
PHP

--TEST--
Bug #45251 (double free or corruption with setAttributeNode())
--EXTENSIONS--
dom
--FILE--
<?php
$doc = new DOMDocument;
$doc->loadXml(<<<EOF
<?xml version="1.0" encoding="utf-8" ?>
<aaa>
<bbb foo="bar"/>
</aaa>
EOF
);
$xpath = new DOMXPath($doc);
$bbb = $xpath->query('bbb', $doc->documentElement)->item(0);
$ccc = $doc->createElement('ccc');
foreach ($bbb->attributes as $attr)
{
$ccc->setAttributeNode($attr);
}
echo $attr->parentNode->localName;
?>
--EXPECT--
ccc