Bug #17781: Array assignment through method
| From: | Oliver dot Siegmar at xams dot org | Date: | Sun, 16 Jun 2002 12:59:14 +0000 |
| Subject: | Bug #17781: Array assignment through method | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-10705@lists.php.net to get a copy of this message | ||
From: Oliver.Siegmar@xams.org
Operating system: Linux
PHP version: 4.1.2
PHP Bug Type: Class/Object related
Bug description: Array assignment through method
<?php
class testclass {
function assign($var, $value) {
$this->$var = $value;
}
}
$testobj = new testclass();
$testobj->testvar = 20;
$testobj->assign("testvar", 30);
echo $testobj->testvar; // Result = 30 - very good!
$testobj->testarray["dim1"]["dim2"] = 20;
$testobj->assign("testarray[dim1][dim2]", 30);
echo $testobj->testarray["dim1"]["dim2"]; // Result = 20 - bad (should be
30)!
?>
--
Edit bug report at http://bugs.php.net/?id=17781&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17781&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17781&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17781&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17781&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17781&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17781&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17781&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17781&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17781&r=globals