Function Overloading in PHP5 and PHP4
February 12th, 2005
This is a solution to the problem of argument type based overloading in PHP. As far as I know this should work in PHP4 and PHP5.
class Viewer {
function display($v) {
$class = get_class($v);
$function = “display_$class”;
if(method_exists($this, $function) ){
[…]