note 69581 added to function.simplexml-element-construct

From: Date: Mon, 11 Sep 2006 21:28:50 +0000
Subject: note 69581 added to function.simplexml-element-construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-117029@lists.php.net to get a copy of this message
According to the these docs (above) for SimpleXMLElement->__construct(), there are several optional parameters. However, when I try to use the additional "options" parameter, PHP reports errors. In my simplest example to reproduce, the code is: <?php $testXml = "<root><testnode>hi</testnode></root>"; $xml = new SimpleXMLElement($testXml,LIBXML_NOENT); echo $xml->root->testnode;[/CODE] ?> The resulting error is: <b>Fatal error</b>: Uncaught exception 'Exception' with message 'SimpleXMLElement::__construct() expects exactly 1 parameter, 2 given' in C:\workspace\eclipse\web\test.php:18 Stack trace: #0 C:\workspace\eclipse\web\test.php(18): SimpleXMLElement->__construct('<root><testnode...', 2) #1 {main} thrown in <b>C:\workspace\eclipse\web\test.php</b> on line <b>18</b><br /> I have checked the various, related versions to make sure my environment supports these options, and they should. PHP Version 5.1.1 libXML Version 2.6.11 SimpleXML, Revision $Revision: 1.151.2.7 $ Any assistance would be greatly appreciated! - Lon php ( A.T ) lonbinder ( D.O.T) com ---- Server IP: 216.194.113.175 Probable Submitter: 160.79.127.67 ---- Manual Page -- http://www.php.net/manual/en/function.simplexml-element-construct.php Edit -- https://master.php.net/note/edit/69581 Del: integrated -- https://master.php.net/note/delete/69581/integrated Del: useless -- https://master.php.net/note/delete/69581/useless Del: bad code -- https://master.php.net/note/delete/69581/bad+code Del: spam -- https://master.php.net/note/delete/69581/spam Del: non-english -- https://master.php.net/note/delete/69581/non-english Del: in docs -- https://master.php.net/note/delete/69581/in+docs Del: other reasons-- https://master.php.net/note/delete/69581 Reject -- https://master.php.net/note/reject/69581 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117029) next »