class Test
{
public $pr = "Property from class Test";
public function __construct()
{
echo 'Constructor activated from class Test <br />';
}
public function __destruct()
{
echo '<br /> Destructor activated from class Test <br />';
}
public function setProperty($val)
{
$this->pr = $val;
}
public function getProperty()
{
return $this->pr;
}
}
if (class_exists('Test')) {
$test_class = new Test();
echo $test_class->getProperty();
}
/*
run:
Constructor activated from class Test
Property from class Test
Destructor activated from class Test
*/