xref: /php-src/ext/dom/tests/gh16533.phpt (revision a0a7361b)
1--TEST--
2GH-16533 (Segfault when adding attribute to parent that is not an element)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$doc = new DOMDocument();
9try {
10    $doc->appendChild($doc->createAttribute('foo'));
11} catch (DOMException $e) {
12    echo $e->getMessage(), "\n";
13}
14
15echo $doc->saveXML();
16
17?>
18--EXPECT--
19Hierarchy Request Error
20<?xml version="1.0"?>
21