"Fossies" - the Fresh Open Source Software Archive

Member "php-8.0.28-src/ext/simplexml/tests/001.phpt" (14 Feb 2023, 773 Bytes) of package /windows/www/php-8.0.28-src.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 SimpleXML: Simple document
    3 --SKIPIF--
    4 <?php if (!extension_loaded("simplexml")) print "skip"; ?>
    5 --FILE--
    6 <?php
    7 
    8 var_dump(simplexml_load_file(__DIR__.'/sxe.xml'));
    9 
   10 ?>
   11 --EXPECTF--
   12 object(SimpleXMLElement)#%d (2) {
   13   ["@attributes"]=>
   14   array(1) {
   15     ["id"]=>
   16     string(5) "elem1"
   17   }
   18   ["elem1"]=>
   19   object(SimpleXMLElement)#%d (3) {
   20     ["@attributes"]=>
   21     array(1) {
   22       ["attr1"]=>
   23       string(5) "first"
   24     }
   25     ["comment"]=>
   26     object(SimpleXMLElement)#%d (0) {
   27     }
   28     ["elem2"]=>
   29     object(SimpleXMLElement)#%d (1) {
   30       ["elem3"]=>
   31       object(SimpleXMLElement)#%d (1) {
   32         ["elem4"]=>
   33         object(SimpleXMLElement)#%d (1) {
   34           ["test"]=>
   35           object(SimpleXMLElement)#%d (0) {
   36           }
   37         }
   38       }
   39     }
   40   }
   41 }