php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37217 overloading not working with arrays not stored as arrays
Submitted: 2006-04-27 07:00 UTC Modified: 2006-04-29 11:40 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ahayes at wcg dot net dot au Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.1.2 OS: Fedora Core 5
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: ahayes at wcg dot net dot au
New email:
PHP Version: OS:

 

 [2006-04-27 07:00 UTC] ahayes at wcg dot net dot au
Description:
------------
Please note I would like to submit bug 33941 as it still occurs within PHP 5.1.2 however it is stated at the mentioned bug report that it fixed as of PHP 5.0.4.

Please see: http://bugs.php.net/bug.php?id=33941

dmitry states initially that the bug is not fixable @ 5 Aug 2005 12:06pm UTC however then later it states that the bug has been fixed.

Can you please supply information as to whether this bug has been fixed or not?

Thanks
Alex

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

class ex {
  public function __get($prop) {
    return unserialize($this->fields[$prop]);
  }

  public function __set($prop, $value) {
    $this->fields[$prop] = serialize($value);
  }

  private $fields;
}

$obj = new ex;
$obj->prop = array(4 => 'pear');
$obj->prop[5] = 'apple';

var_dump($obj->prop);
?>

Expected result:
----------------
array(1) {
  [4]=>
  string(4) "pear"
  [5]=>
  string(5) "apple"
}

Actual result:
--------------
array(1) {
  [4]=>
  string(4) "pear"
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-29 11:40 UTC] mike@php.net
Sorry, bug #33941 should have been marked as "Won't fix" as far as I can see.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 03 12:01:30 2024 UTC