Try something like this:
<?php
class Foo {
public function show($stuff, $extra = '') {
echo $stuff, $extra;
}
public function __call($method, $args) {
if (preg_match('/^show(.+)$/i', $method, $matches)) {
list(, $stuff) = $matches;
array_unshift($args, $stuff);
return call_user_func_array(array($this, 'show'), $args);
}
else {
trigger_error('Unknown function '.__CLASS__.':'.$method, E_USER_ERROR);
}
}
}
$test = new Foo;
$test->showStuff();
$test->showMoreStuff(' and me too');
$test->showEvenMoreStuff();
$test->thisDoesNothing();
Output:
StuffMoreStuff and me tooEvenMoreStuff