在php对象中保存内存

I have a class in php with a method similar to the two below. I am wondering what is the most optimal way to write this class? I need to use the disp_info method a lot and would like to know if it is wiser to place $message1 and $message2 outside of the function and call it in so I would not have to generate a new message every time or the other way around.

class Person(){
    public $name;
    public $age;
    public $sex;
    public $result;

    public function disp_info(){
        $message1= "Hello my name is : ";
        $message2= "And my age is :";
        $this->result= $message1.$this->name.$message2.$this->age;
    }

    $this->disp_name();
}

class Person(){
    public $name;
    public $age;
    public $sex;
    public $result;
    public $message1= "Hello my name is : ";
    public $message2= "And my age is :";

    public function disp_info(){
        $message1 = $this->message1
        $message2 = $this->message2
        $this->result = $message1.$this->name.$message2.$this->age;
    }

    $this->disp_name();
}

Thanks, Please enlighten me

I can't think of any reason for using static variables in a class. It even somehow contradicts the whole concept of classes. Generally, you better won't use the first method. About optimization - the different would be measured in ms , the question is about which method would run faster - you could easly run a test and measure runtime of both methods.