Annotation of embedaddon/php/ext/simplexml/tests/030.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: SimpleXML: isset and unset by offset
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
        !             5: --FILE--
        !             6: <?php 
        !             7: $xml =<<<EOF
        !             8: <root s:att1="b" att1="a" 
        !             9:       xmlns:s="urn::test" xmlns:t="urn::test-t">
        !            10:    <child1>test</child1>
        !            11:    <child1>test 2</child1>
        !            12:    <s:child3 />
        !            13: </root>
        !            14: EOF;
        !            15: 
        !            16: $sxe = simplexml_load_string($xml);
        !            17: 
        !            18: echo $sxe->child1[0]."\n";
        !            19: echo $sxe->child1[1]."\n\n";
        !            20: 
        !            21: var_dump(isset($sxe->child1[1]));
        !            22: unset($sxe->child1[1]);
        !            23: var_dump(isset($sxe->child1[1]));
        !            24: echo "\n";
        !            25: 
        !            26: $atts = $sxe->attributes("urn::test");
        !            27: var_dump(isset($atts[0]));
        !            28: unset($atts[0]);
        !            29: var_dump(isset($atts[0]));
        !            30: var_dump(isset($atts[TRUE]));
        !            31: 
        !            32: ?>
        !            33: ===DONE===
        !            34: --EXPECT--
        !            35: test
        !            36: test 2
        !            37: 
        !            38: bool(true)
        !            39: bool(false)
        !            40: 
        !            41: bool(true)
        !            42: bool(false)
        !            43: bool(false)
        !            44: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>