<?php
class test
{
public
function __construct() {
$this->start();
}
private
function start()
{
print("This is wrong!\n");
}
}
class mytest extends test
{
public
function tryout()
{
$this->start();
}
protected
function start()
{
print("This is right!\n");
}
}
class mymytest extends mytest
{
public
function start()
{
print("This is different!\n");
}
}
$w = new mymytest();
$w->tryout();
$w->start();
?>
bledmeerfaste:~ # php5 test.php
This is wrong!
This is different!
This is different!