OpenSwoole\Table->destroy

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\Table->destroy()

Parameters

Return

Description

Destroy a table and free the memory.

Example

<?php

$table = new OpenSwoole\Table(1024);
$table->column('id', OpenSwoole\Table::TYPE_INT);
$table->column('name', OpenSwoole\Table::TYPE_STRING, 64);
$table->column('num', OpenSwoole\Table::TYPE_FLOAT);
$table->create();

$table['apple'] = array('id' => 145, 'name' => 'iPhone', 'num' => 3.1415);
$table['google'] = array('id' => 358, 'name' => "AlphaGo", 'num' => 3.1415);
$table['microsoft']['name'] = "Windows";
$table['microsoft']['num'] = '1997.03';

var_dump($table['apple']);
var_dump($table['microsoft']);
$table['google']['num'] = 500.90;
var_dump($table['google']);

$table->destroy();
Last updated on September 1, 2022