mirror of
https://github.com/php/presentations.git
synced 2026-03-24 15:42:33 +01:00
24 lines
280 B
PHP
24 lines
280 B
PHP
<?php
|
|
|
|
class Brand {
|
|
final function show() {
|
|
echo "The Pepsi Generation\n";
|
|
}
|
|
}
|
|
|
|
final class BrandX extends Brand {
|
|
}
|
|
|
|
$t = new Brand();
|
|
$t->show();
|
|
|
|
class BetterBrand extends BrandX {
|
|
function show() {
|
|
echo "Coke is better\n";
|
|
}
|
|
}
|
|
|
|
$t = new BetterBrand();
|
|
$t->show();
|
|
?>
|