Follow the original code:
class Table{
private static $table;
public static function draw( stdData $data ){
self::$table = new self;
return self::$table->_draw( $data );
}
...
I made this modification below to try to circumvent a possible memory problem:
class Table{
private static $table;
public static function draw( stdData $data ){
self::$table = new self;
$html = self::$table->_draw( $data );
unset(self::$table);
return $html;
...
But it caused a problem:
Fatal error: Attempt to unset static property Table::$table in Table.php on line 8
Does the original code cause any memory problems? What would be the correct way out of the problem?
That is, does it occupy memory space unnecessarily?
The goal is to use echo Table::draw($data);
at another time to print a table and that after use has nothing in memory because of that.