Geçerli sınıfının dışında bir sınıfta bir yöntemi çağırmak için bir yolu var mı? Örnek olarak:
class firstclass
{
function method1()
{
return "foo";
}
}
class secondclass
{
function method2()
{
$myvar = firstclass::method1;
return $myvar;
}
}
Where the $myvar = firstclass::method1;
is an attempt to access the firstclass method1.
The desired result in this example would be $myvar = "foo"
.
Ben "genişletmek" kullanabilirsiniz biliyorum, ama "genişletmek" olmadan bunu yapmak için bir yol olup olmadığını bilmek istedi?