summaryrefslogtreecommitdiff
path: root/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt
blob: 67a66ae16ea3565cf12180d9f321ca54fe37db81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Read $ownerElement with null parent.
--CREDITS--
Travis Pew
# TestFest Atlanta 2009-05-14
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php

$document = new DOMDocument;
$root = $document->createElement('root');
$document->appendChild($root);
$attr = $root->setAttribute('category', 'books');
$document->removeChild($root);
$root = null;
try {
    var_dump($attr->ownerElement);
} catch (\Error $e) {
    echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
Error: Couldn't fetch DOMAttr. Node no longer exists