#43685 [Opn->Csd]: Dom->importNode() returns FALSE instead of the Exception

From: Date: Fri, 28 Dec 2007 17:47:15 +0000
Subject: #43685 [Opn->Csd]: Dom->importNode() returns FALSE instead of the Exception
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-391@lists.php.net to get a copy of this message
ID: 43685 Updated by: felipe@php.net Reported By: programatorfreez at gmail dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Gentoo GNU/Linux PHP Version: 5.2.5 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2007-12-27 12:35:15] rrichards@php.net Documentation issue. Method return false when node cannot be copied. ------------------------------------------------------------------------ [2007-12-27 02:44:55] programatorfreez at gmail dot com Description: ------------ There is a DomException in the documentation of Dom->importNode(), but it returns FALSE on fail without a reason. Reproduce code: --------------- /** * Import node to dom * * @param DomElement node which will be imported * @param boolean deep (use recursive importing - default TRUE) * @return DomElement reference to created node */ public function domImportNode($node, $deep = TRUE) { if (FALSE === ($sxe = $this->dom->importNode($node, $deep))) { throw new Exception('importNode failed.'); } $sxe = $this->dom->appendChild($sxe); return $sxe; } Expected result: ---------------- DomException Actual result: -------------- My Exception ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43685&edit=1

« previous php.doc.bugs (#391) next »