// in php you must declare __construct method and
//then use void for all methods that you want.
class Test{
public $name = "mohamad";
public function __construct(){}
public function test():void {
}
}
$obj = new Test();
echo $obj->test();
echo $obj->name;