I don't know how to explain this better, so (see comment inside second class):
<?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?
}
}
?>
$this(insidemain) to the constructor ofchild. Be careful you don't end up with spaghetti, though!