mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
For rationale, see #6787 Extensions migrated in part 4: * simplexml * skeleton * soap * spl * sqlite3 * sysvmsg * sysvsem * tidy - also removed a check for an ancient dependency version
36 lines
676 B
PHP
36 lines
676 B
PHP
--TEST--
|
|
Bug #72971 (2): SimpleXML property write does not respect namespace
|
|
--EXTENSIONS--
|
|
simplexml
|
|
--FILE--
|
|
<?php
|
|
|
|
$xml = new SimpleXMLElement('<root xmlns:ns="ns"><foo>bar</foo><ns:foo>ns:bar</ns:foo></root>');
|
|
|
|
$xml->foo = 'new-bar';
|
|
var_dump($xml->foo);
|
|
var_dump($xml->children('ns')->foo);
|
|
|
|
$xml->children('ns')->foo = 'ns:new-bar';
|
|
var_dump($xml->foo);
|
|
var_dump($xml->children('ns')->foo);
|
|
|
|
?>
|
|
--EXPECT--
|
|
object(SimpleXMLElement)#2 (1) {
|
|
[0]=>
|
|
string(7) "new-bar"
|
|
}
|
|
object(SimpleXMLElement)#3 (1) {
|
|
[0]=>
|
|
string(6) "ns:bar"
|
|
}
|
|
object(SimpleXMLElement)#3 (1) {
|
|
[0]=>
|
|
string(7) "new-bar"
|
|
}
|
|
object(SimpleXMLElement)#2 (1) {
|
|
[0]=>
|
|
string(10) "ns:new-bar"
|
|
}
|