bug38474.phpt

来自「PHP v6.0 For Linux 运行环境:Win9X/ WinME/ Wi」· PHPT 代码 · 共 42 行

PHPT
42
字号
--TEST--Bug #38474 (getAttribute select attribute by order, even when prefixed)--SKIPIF--<?php require_once('skipif.inc'); ?>--FILE--<?php$xml = b'<node xmlns:pre="http://foo.com/tr/pre"               xmlns:post="http://foo.com/tr/post"              pre:type="bar" type="foo" ><sub /></node>';$dom = new DomDocument();$dom->loadXML($xml);echo $dom->firstChild->getAttribute('type')."\n";echo $dom->firstChild->getAttribute('pre:type')."\n";$dom->firstChild->setAttribute('pre:type', 'bar2');$dom->firstChild->setAttribute('type', 'foo2');$dom->firstChild->setAttribute('post:type', 'baz');$dom->firstChild->setAttribute('new:type', 'baz2');echo $dom->firstChild->getAttribute('type')."\n";echo $dom->firstChild->getAttribute('pre:type')."\n";echo $dom->firstChild->getAttribute('post:type')."\n";$dom->firstChild->removeAttribute('pre:type');$dom->firstChild->removeAttribute('type');echo $dom->firstChild->getAttribute('type')."\n";echo $dom->firstChild->getAttribute('pre:type')."\n";echo $dom->firstChild->getAttribute('post:type')."\n";echo $dom->firstChild->getAttribute('new:type');?>--EXPECT--foobarfoo2bar2bazbazbaz2

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?