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

1.1     ! misho       1: --TEST--
        !             2: Bug #38406 (crash when assigning objects to SimpleXML attributes)
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded("simplexml")) print "skip"; ?>
        !             5: --FILE--
        !             6: <?php
        !             7: 
        !             8: $item = new SimpleXMLElement(b'<something />');
        !             9: $item->attribute = b'something';
        !            10: var_dump($item->attribute);
        !            11: 
        !            12: $item->otherAttribute = $item->attribute;
        !            13: var_dump($item->otherAttribute);
        !            14: 
        !            15: $a = array();
        !            16: $item->$a = new stdclass;
        !            17: 
        !            18: echo "Done\n";
        !            19: ?>
        !            20: --EXPECTF--    
        !            21: object(SimpleXMLElement)#%d (1) {
        !            22:   [0]=>
        !            23:   string(9) "something"
        !            24: }
        !            25: object(SimpleXMLElement)#%d (1) {
        !            26:   [0]=>
        !            27:   string(9) "something"
        !            28: }
        !            29: 
        !            30: Notice: Array to string conversion in %s on line %d
        !            31: 
        !            32: Warning: It is not yet possible to assign complex types to properties in %s on line %d
        !            33: Done

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