|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-05-24 13:18 UTC] sbergmann@php.net
[2001-05-24 15:23 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 04:00:02 2025 UTC |
There seems to be a problem with objects returned from class methods by reference: <?php class a { var $data; function add_data($data) { $this->data[] = $data; } } class b { var $a; function &add_a() { $this->a = new a; return $this->a; } function dump() { print_r($this->a->data); } } $b = new b; $a = $b->add_a(); $a->add_data('test'); // works not $b->a->add_data('test'); // works $b->dump(); ?>