Codice PHP:
class A{
    public function 
__construct(){
    }
    public function 
test(){
        echo 
'Hello world';
    }
}

function 
test($obj){
    
$obj->test();
}
$obj= new A();
test($obj); 
si può senz'altro sbagli qc prima.