私は独自の PHP フレームワークを作成してきましたが、この問題が発生しました。答えが見つからないため、この方法でコーディングしたパターンとして作成します。
class post_control extends LoopControl
{
var $model;
function __construct()
{
parent::__construct();
$classname = get_class($this);
$this->model = new $classname();
}
}
私はこのエラーが発生します:
致命的なエラー: 23 行目の /opt/lampp/htdocs/LoopWork/admin/core/model/Form.class.php で 134217728 バイトの許容メモリ サイズが使い果たされました (77 バイトを割り当てようとしました)。
質問2:
私は本当に多くのメモリを使用していますか?どのように ?
事実 1:
new post_model(); をコーディングすると、このエラーは発生しません。
事実 1 を考慮すると、クラスの新しいスタンスを作成するこれらの方法には違いがあると思います。
もうありがとう!