Bug #50405 [Ver->Wfx]: SimpleXML __get and __set are not invoked
| From: | mike@php.net | Date: | Wed, 19 May 2010 06:26:33 +0000 |
| Subject: | Bug #50405 [Ver->Wfx]: SimpleXML __get and __set are not invoked | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150585@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50405&edit=1
ID: 50405
Updated by: mike@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] mike@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