Hello,

I have a problem understanding following chunk of code. It seems that global
$rme does not remember an reference to $this, but instead it is remembering
null or something like that:

<?PHP

class A {
        function rememberMe() {
            global $rme;
            $rme = & $this;
            $this->someInstanceVar =77;
        }

        function report() {
            global $rme;
            echo 'X';  print_r($rme); echo 'X';
 }
}

$a = new A();
$a->rememberMe();
$a->report();

?>

This little script outputs:
XX

While I would expect it to return:

Xa Object ( [someInstanceVar] => 77 ) X

rush
--
http://www.templatetamer.com/

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

Reply via email to