<?php
class test { function test($val) { global $myref; $myref = &$this; $this->value = $val; } function printval() { echo "The value of this class is '{$this->value}' <br>"; } function setval($val) { $this->value = $val; } }
$a = new test(); $b = &$a; $c = new test();
$a->setval(22); $b->setval(321); $c->setval('A weird comment');
$a->printval(); // should see 321 $b->printval(); // should see 321 $c->printval(); // should see A weird comment
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php