在php类中使用md5(时间)

I want to generate a unique Order id for customer orders. I am trying to declare it as a public variable in class after class initilizing. It is giving me error. Where as I already using one static variable.

I'm trying to do this

    public $payment_link = "http://www.example.com/order?order_id=";
    public $id = md5(time());

Prior to PHP 5.6, you couldn't use any expression for the default value of a property. Now, you can use basic expressions like 1+2 but function calls are still not permitted. Set the value in the constructor if need be:

public $id;

public function __construct() {
    $this->id = md5(time());
}