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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC