<?php
class anotherfoo {
private $testvar = array ('test'=> 10);
function __get($varname) {
return $this->testvar[$name];
}
function __set($varname, $value) {
$this->testvar[$name] = $value;
}
}
$varinst = new anotherfoo();
$varinst->test++;
echo "The value of 'test' is {$varinst->test}";
?>