2003-02-06 07:07:24 +08:00
|
|
|
--TEST--
|
2003-08-09 22:48:47 +08:00
|
|
|
ZE2 A private method can be overwritten in a second derived class
|
2003-02-06 07:07:24 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class first {
|
|
|
|
private function show() {
|
|
|
|
echo "Call show()\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
public function do_show() {
|
|
|
|
$this->show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$t1 = new first();
|
|
|
|
$t1->do_show();
|
|
|
|
|
|
|
|
class second extends first {
|
|
|
|
}
|
|
|
|
|
|
|
|
//$t2 = new second();
|
|
|
|
//$t2->do_show();
|
|
|
|
|
|
|
|
class third extends second {
|
|
|
|
private function show() {
|
|
|
|
echo "Call show()\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$t3 = new third();
|
|
|
|
$t3->do_show();
|
|
|
|
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
2018-02-19 16:59:41 +08:00
|
|
|
--EXPECT--
|
2003-02-06 07:07:24 +08:00
|
|
|
Call show()
|
|
|
|
Call show()
|
2014-12-15 02:20:23 +08:00
|
|
|
Done
|