Damn! It is still wrong because the parent:: call didn't have to occure in the $class class but in any of its parents. Which means the only possible way to find out is debug_backtrace(). I don't think it's a good idea to use debug backtrace here so I'll just throw an exception with different message.