When writing inside a class you can only have properties (class variables) and methods (functions).
class loai{
private $message="Hey you";
public function __construct(){
echo $this->message;
}
}
$x = new loai();
Maybe you were looking for somthing like that?
so in that example $message is a property and __construct is a method. This particular method is called when a new instance is made (when new loai() is called a new instance is made)