-1

この関数を含むショッピング カート ライブラリがあります。ドキュメントから、次のように述べられています。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);
}
4

1 に答える 1

3

そうじゃ__destructない__deconstruct

http://php.net/manual/en/language.oop5.decon.php

于 2013-01-04T18:34:08.937 に答える