i tried get_class this which results in the name of the class that the function is being called within..
see below for an example
Code: Select all
abstract class basic
{
function name()
{
print get_class($this);
}
}
class advanced extends basic{};
class scope
{
function __construct()
{
advanced::name(); // prints 'scope', the name of THIS class, i want it to print 'advanced'.
}
}
$poo=new scope();
Thing is, if I override the function in the 'advance' class, it kind of defeats the purpose of having the inherited class, I want it to have the name() functionality automatically.
Obviously In my real world code i'm not just trying to get the name of the class, I've just simplified the problem for the sake of this thread being readable
Thanks both of you for your help.