锟教筹拷锟斤拷为锟斤拷锟斤拷锟斤拷锟街拷锟揭伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆o拷PHP 锟侥讹拷锟斤拷模锟斤拷也使锟斤拷锟剿继承★拷锟教承斤拷锟斤拷影锟届到锟斤拷锟斤拷锟洁,锟斤拷锟斤拷锟斤拷锟斤拷锟街拷锟侥癸拷系锟斤拷
锟斤拷锟界,锟斤拷锟斤拷展一锟斤拷锟洁,锟斤拷锟斤拷突锟教承革拷锟斤拷锟斤拷锟叫癸拷锟叫的猴拷锟杰憋拷锟斤拷锟侥凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟洁覆锟斤拷锟剿革拷锟斤拷姆锟斤拷锟斤拷锟斤拷锟斤拷坛械姆锟斤拷锟斤拷锟斤拷岜o拷锟斤拷锟皆拷泄锟斤拷堋锟�
锟教承讹拷锟节癸拷锟杰碉拷锟斤拷坪统锟斤拷锟斤拷欠浅锟斤拷锟斤拷玫模锟斤拷锟斤拷叶锟斤拷锟斤拷锟斤拷频亩锟斤拷锟斤拷锟斤拷锟斤拷鹿锟斤拷芫锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫达拷锟叫╋拷锟斤拷玫墓锟斤拷堋锟�
Note:
锟斤拷锟斤拷使锟斤拷锟斤拷锟皆讹拷锟斤拷锟截o拷锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟绞癸拷锟街帮拷锟斤拷锟斤拷濉o拷锟斤拷一锟斤拷锟斤拷锟斤拷展锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街帮拷锟斤拷锟斤拷锟斤拷锟斤拷斯锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟教筹拷锟斤拷锟斤拷锟斤拷锟斤拷涌凇锟�
Example #1 锟教筹拷示锟斤拷
<?php
class foo
{
public function printItem($string)
{
echo 'Foo: ' . $string . PHP_EOL;
}
public function printPHP()
{
echo 'PHP is great.' . PHP_EOL;
}
}
class bar extends foo
{
public function printItem($string)
{
echo 'Bar: ' . $string . PHP_EOL;
}
}
$foo = new foo();
$bar = new bar();
$foo->printItem('baz'); // Output: 'Foo: baz'
$foo->printPHP(); // Output: 'PHP is great'
$bar->printItem('baz'); // Output: 'Bar: baz'
$bar->printPHP(); // Output: 'PHP is great'
?>