Bug #45971 [Com]: SimpleXMLElement does not overload properly

From: Date: Mon, 06 Sep 2010 12:39:43 +0000
Subject: Bug #45971 [Com]: SimpleXMLElement does not overload properly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-154110@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=45971&edit=1

 ID:                 45971
 Comment by:         andreas at softwaredesign dot se
 Reported by:        dennis at d23 dot nl
 Summary:            SimpleXMLElement does not overload properly
 Status:             No Feedback
 Type:               Bug
 Package:            SimpleXML related
 Operating System:   *
 PHP Version:        5.2.6
 Block user comment: N

 New Comment:

Still get the exact same results. 

My PHP version is:
PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch (cli) (built: May 13 2010
20:03:45) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

(The default version in ubuntu 10.04 repositories).


Previous Comments:
------------------------------------------------------------------------
[2009-02-20 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2009-02-13 00:15:16] jani@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------
[2008-09-02 09:56:51] dennis at d23 dot nl

Description:
------------
When extending SimpleXMLElement the __get() and __set() methods of the
extending class do not get invoked. 
__call however works as expected.

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=45971&edit=1


Thread (4 messages)

« previous php.bugs (#154110) next »