我不知道如何更好地解释这一点,所以(见第二课内的评论):
<?php
class main {
public function something() {
echo("do something");
}
public function something_else() {
$child=new child();
$child->child_function();
}
}
class child {
public function child_function() {
echo("child function");
//is it possible to call main->something() here somehow if this class is initiated inside class main?
}
}
?>