ID:               39426
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wmalota at php-art dot pl
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux/Debian
 PHP Version:      5.2.0
 New Comment:

Turn on error reporting and you'll see:

Notice: Indirect modification of overloaded property test::$data has no
effect in /tmp/2.php on line 15

Notice: Indirect modification of overloaded property test::$data has no
effect in /tmp/2.php on line 16

Notice: Indirect modification of overloaded property test::$data has no
effect in /tmp/2.php on line 19
NULL



Previous Comments:
------------------------------------------------------------------------

[2006-11-08 08:57:06] wmalota at php-art dot pl

Description:
------------
Copying an array returned by __get to other array returned by __get
from other object gives wrong effect.

Reproduce code:
---------------
class test {
  private $variables = array();

  public function & __get($name) {
    return $this->variables[$name];
  }
  public function __set($name, $value) {
    $this->variables[$name] = $value;
  }
}

$test1 = new test;
$test1->data['sth1'] = 'sth1';
$test1->data['sth2'] = 'sth2';

$test2 = new test;
$test2->data['rewritten'] = $test1->data;

echo($test2->data['rewritten']['sth1']);

Expected result:
----------------
I expected that on the screen I see this text:

sth1

On PHP 5.1.x it works properly.

Actual result:
--------------
On the screen I see text:

Array


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39426&edit=1

Reply via email to