PHP 5 will also support the idea of a "final" member variable or property
which prevents any further extending of that class
<?php
final class final_example {
function foobar() { /* ... */ }
}
/* You can't do this, final_example is declared final */
class tester extends final_example {
function foobar() { /* ... */ }
}
?>
Member methods may also be declared final, preventing them specifically
from being overloaded in a sub class
<?php
class finalfunc {
final function dosomething() { /* ... */ }
function foobar() { /* ... */ }
}
class anotherclass extends finalfunc {
function foobar() { /* something more */ }
/* This can't work, dosomething() is 'final' */
function dosomething() { /* This breaks */ }
}
?>