<?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;
}
}
?>My question is actually regarding the line "$myref = &$this;". The author states that this is a reference to the class/object itself. Isn't this like saying outside the class "$myref =& new test;"? What would be the point of referring to itself inside the class in this manner? Thanks for your help in advance!
-Adam Reiswig
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

