Class test{
function test1()
{
echo \'inside test1\';
}
function test2()
{
echo \'test2\';
}
function test3()
{
The only way to do this is using the magic __call. You need to make all methods private so they are not accessable from the outside. Then define the __call method to handle the method calls. In __call you then can execute whatever function you want before calling the function that was intentionally called.