#42235 [NEW]: Overloaded properties not allowing modification
| From: | stephen dot cuppett at webmastersinc dot net | Date: | Tue, 07 Aug 2007 16:27:23 +0000 |
| Subject: | #42235 [NEW]: Overloaded properties not allowing modification | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-115850@lists.php.net to get a copy of this message | ||
From: stephen dot cuppett at webmastersinc dot net
Operating system: Windows and Linux
PHP version: 5.2.4RC1
PHP Bug Type: Class/Object related
Bug description: Overloaded properties not allowing modification
Description:
------------
Also documented in: http://pear.php.net/bugs/bug.php?id=11775
There appears to be a regression as to Bug #39449:
http://bugs.php.net/bug.php?id=39449
On 5.2.4RC1, I'm getting the immutable overloaded properties problem with
DB_DataObject and in the simple test below.
Also bugs:
41116, 40828, 40823, 39990
Reproduce code:
---------------
<?php
class MyObj {
private $map;
public function __construct() {
$this->map = array();
}
public function __set($vn, $value) {
$this->map[$vn] = $value;
}
public function __get($vn) {
return $this->map[$vn];
}
}
$myvar = new MyObj();
$myvar->test_var = array();
$myvar->test_var['tester'] = 3;
$myvar->test_var['tester2'] = 5;
var_dump($myvar->test_var);
?>
Expected result:
----------------
C:\temp\dataobject_test>php simpletest.php
array(2) {
["tester"]=>
int(3)
["tester2"]=>
int(5)
}
Actual result:
--------------
C:\temp\dataobject_test>php simpletest.php
PHP Notice: Indirect modification of overloaded property MyObj::$test_var
has no effect in C:\temp\dataobject_test\simpletest.php on line 16
Notice: Indirect modification of overloaded property MyObj::$test_var has
no effect in C:\temp\dataobject_test\simpletest.php on line 16
PHP Notice: Indirect modification of overloaded property MyObj::$test_var
has no effect in C:\temp\dataobject_test\simpletest.php on line 17
Notice: Indirect modification of overloaded property MyObj::$test_var has
no effect in C:\temp\dataobject_test\simpletest.php on line 17
array(0) {
}
--
Edit bug report at http://bugs.php.net/?id=42235&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42235&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42235&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42235&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42235&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42235&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42235&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42235&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42235&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42235&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42235&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42235&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42235&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42235&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42235&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42235&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42235&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42235&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42235&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42235&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42235&r=mysqlcfg