note 17111 rejected from language.oop by zak

From: Date: Mon, 26 Nov 2001 23:42:45 +0000
Subject: note 17111 rejected from language.oop by zak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21300@lists.php.net to get a copy of this message
I have tried to get the referencing to work in a class, but.... here is an example: class test { function one($t) { $this->t = $t; } } class test2 { function &store(&$t) { $this->t = $t; } } $w = new test(); $w->one(3); print $w->t."\n"; $q = new test2(); $q->store(&$w); $w->one(5); print $w->t."\n"; print $q->t->t."\n"; --------- this prints 3 5 3, which is wrong. I have tried all variants of including & in the calls, but no one works.

« previous php.notes (#21300) next »