#36743 [Opn]: Array data members behave incorrect when class inherits from builtin one.

From: Date: Wed, 15 Mar 2006 12:47:28 +0000
Subject: #36743 [Opn]: Array data members behave incorrect when class inherits from builtin one.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-94367@lists.php.net to get a copy of this message
 ID:               36743
 Updated by:       tony2001@php.net
 Reported By:      maximgb at yandex dot ru
 Status:           Open
-Bug Type:         Scripting Engine problem
+Bug Type:         SimpleXML related
 Operating System: Windows XP SP2
 PHP Version:      5.1.2
 New Comment:

Reclassified as SimpleXML problem.


Previous Comments:
------------------------------------------------------------------------

[2006-03-15 13:35:43] maximgb at yandex dot ru

Description:
------------
Array data members behave incorrect when class inherits from builtin
one. The first push to the member array is ignored, the other pushes
work as usual.

Reproduce code:
---------------
class Test extends XMLReader
{
    private $testArr = array();

    public function __construct()
    {
        $this->testArr[] = 1;
        var_dump($this->testArr);
    }
}

Expected result:
----------------
array(1) {
   [0] => int(1)
}

Actual result:
--------------
array(0) {
}


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


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


Thread (4 messages)

« previous php.bugs (#94367) next »