Привет!

> <?php
> 
>   class test {
>     function test() {
>       $globals['test2'] = &$this;
>     }
>   }
> 
>   $test1 = new test();
> 
> ?>
> 
> The problem hier is that $globals['test2'] is a copy of $globals['test1'] not a 
> references.

It is, but you are looking in the wrong direction. the copy is in test1, 
test2 holds the reference.

This should work:

<?php
 >
 >   class test {
 >     function &test() {
 >       $globals['test2'] = &$this;
 >     }
 >   }
 >
 >   $test1 = new test();
 >
 > ?>

To output a reference instead of a copy a function *must* be declared 
with an &. Not sure whether you might also need it here:

$test1 = new &test();

check it out

пока
Альберто
Киев

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to