PHP class constructor?
I'm useed to object orientated programming (C#) so now I'n switching to php its time to write classes. But there's something I don't get in the following code:
<?php
Class path{
private $serverPath;
function _construct()
{
$this->serverPath = $_SERVER['DOCUMENT_ROOT'];
}
public function getServerpath()
{
return $this->serverPath;
}
public function rel2abs ($relpath)
{
if (substr($relpath,0) != "/") $relpath = "/".$relpath;
$relpath = $this->serverPath .$relpath;
return realpath($relpath);
}
}
?>
After debugging it appears that after the object is constructed the private value $serverPath remains NULL ?