我有一个包含此功能的购物车库。从documentation开始说明:PHP 5 introduces a destructor concept similar to that of other object-oriented languages, such as C++. The destructor method will be called as soon as there are no other references to a particular object, or in any order during the shutdown sequence.
我不确定为什么没有召唤这个。任何人都可以对此有所了解吗?
public function __deconstruct () {
Yii::app()->session->add('cart', $this->order);
}