hello.
i have some problem with object property inheritance.
take this code for example:
<?php
class base {
public $v;
public function setV($value)
{
$this->v = $value;
}
public function getV() {
return $this->v;
}
}
class child extends base {
}
$base = new base();
$base->setV("val");
print $base->getV(); // this works fine, it prints "val"
$child = new child();
print $child->getV(); // this doesn't
?>
why is $child->getV() not returning anything?
also, how can i fix this?
Thanks.