--- Catch exception with try/catch object(DOMException)#3 (6) { ["message:protected"]=> string(23) "Hierarchy Request Error" ["string:private"]=> string(0) "" ["file:protected"]=> string(49) "/usr/local/src/php-5.0.4/ext/dom/tests/dom003.php" ["line:protected"]=> int(8) ["trace:private"]=> array(1) { [0]=> array(6) { ["file"]=> string(49) "/usr/local/src/php-5.0.4/ext/dom/tests/dom003.php" ["line"]=> int(8) ["function"]=> string(11) "appendChild" ["class"]=> string(10) "DOMElement" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> object(DOMElement)#2 (0) { } } } } ["code"]=> int(3) } --- Don't catch exception with try/catch Fatal error: Uncaught exception 'DOMException' with message 'Hierarchy Request Error' in /usr/local/src/php-5.0.4/ext/dom/tests/dom003.php:13 Stack trace: #0 /usr/local/src/php-5.0.4/ext/dom/tests/dom003.php(13): DOMElement->appendChild(Object(DOMElement)) #1 {main} thrown in /usr/local/src/php-5.0.4/ext/dom/tests/dom003.php on line 13