1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt
Gabriel Caruso 4aabfe911e Revert "Update versions for PHP 8.0.21"
This reverts commit 6eedacdf15.
2022-07-06 12:06:48 +02:00

22 lines
410 B
PHP

--TEST--
SimpleXMLElement->addAttribute()
--SKIPIF--
<?php if (!extension_loaded("simplexml")) die("skip"); ?>
--FILE--
<?php
$simple = simplexml_load_file(__DIR__."/book.xml");
$simple->addAttribute('type','novels');
var_dump($simple->attributes());
echo "Done";
?>
--EXPECT--
object(SimpleXMLElement)#2 (1) {
["@attributes"]=>
array(1) {
["type"]=>
string(6) "novels"
}
}
Done