php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37199 XMLReader doesnt accept array properties
Submitted: 2006-04-25 15:24 UTC Modified: 2006-04-25 15:33 UTC
From: evert at collab dot nl Assigned:
Status: Not a bug Package: *XML functions
PHP Version: 5.1.2 OS: Slackware 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: evert at collab dot nl
New email:
PHP Version: OS:

 

 [2006-04-25 15:24 UTC] evert at collab dot nl
Description:
------------
When i create a new class, derived from XMLReader and I add new (private) properties it works perfectly for simple values (int, string), but when I use arrays, it simply forgets the value.

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

     class MyReader extends XMLReader {

         private $test;
         private $arr = array();

         public function test() {
             // Adding a normal variable works just fine:
             $this->test = 'test';
             echo($this->test);

             // But an array.. is a different story
             $this->arr[0] = '1';
             print_r($this->arr);
             die();
         }

     }

     $v = new MyReader();
     $v->test();
 ?>

Expected result:
----------------
testArray(0=>'1')

or something along those lines

Actual result:
--------------
testArray()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-25 15:33 UTC] pajoye@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

Already fixed in CVS and 5.1.3RC3

http://downloads.php.net/ilia/php-5.1.3RC3.tar.bz2
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 20:03:33 2021 UTC