Let's say we have index.php
class Foo_class extends FOOBAR
{
function __construct()
{
require 'some_other_class.php';
new Some_other_class;
$this->say_hello();
}
}
And some_other_class.php
class Some_other_class
{
function say_hello()
{
echo "Wow, it works!";
}
}
I want, that by including and calling a class Some_other_class
in the Foo_class
class, Some_other_class
class would give Foo_class
all of its methods. Is it possible by doing that and not extending? Of course my code will not work.