Edit report at http://bugs.php.net/bug.php?id=50405&edit=1

 ID:               50405
 Updated by:       m...@php.net
 Reported by:      babooka at hotmail dot com
 Summary:          SimpleXML __get and __set are not invoked
-Status:           Verified
+Status:           Wont fix
 Type:             Bug
 Package:          SimpleXML related
 Operating System: *
 PHP Version:      5.*, 6



Previous Comments:
------------------------------------------------------------------------
[2010-05-19 08:26:16] m...@php.net

SimpleXML is already the magicians nipple, and needs to handle get/set
property operations itself.

------------------------------------------------------------------------
[2009-12-08 03:14:55] babooka at hotmail dot com

Description:
------------
Related to:

http://bonsai.php.net/bug.php?id=45971



SimpleXML magic __get / __set elements are not called, as a result

you can not extend the XML parsing and in addition to that SoapClient's

classmap becomes useless, they are not called there either.

Reproduce code:
---------------
<?php



class TestSimpleXMLElement extends SimpleXMLElement {

    function __set($name, $value) { echo "__set $name\n"; }

    function __get($name) { echo "__get $name\n"; }

    function __call($name, $parameters) { echo "__call $name\n"; }

}



$element = new TestSimpleXMLElement('<root/>');

// __set

$element->child1 = 1;

// __get

$element->child2;

// __call

$element->method();



Expected result:
----------------
__set child1

__get child2

__call method





Actual result:
--------------
__call method




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=50405&edit=1

Reply via email to