GlobalType
Global types classify global variables, which hold a value and can either be mutable or immutable.
<?php declare(strict_types=1);
use Wasm\Type\{GlobalType, ValType};
$valtype = Type\ValType::new(Type\ValType::KIND_I32);
$const = Type\GlobalType::new($valtype);
$valtype = Type\ValType::new(Type\ValType::KIND_I32);
$var = Type\GlobalType::new($valtype, Type\GlobalType::MUTABILITY_VAR);
Tags
Table of Contents
- MUTABILITY_CONST = WASM_CONST
- MUTABILITY_VAR = WASM_VAR
- __construct() : mixed
- Create a Wasm\Type\GlobalType from a `wasm_globaltype_t` resource.
- asExternType() : ExternType
- content() : ValType
- inner() : resource
- Return the inner global type resource.
- mutability() : int
- Return the global type's mutability.
- new() : self
Constants
MUTABILITY_CONST
public
mixed
MUTABILITY_CONST
= WASM_CONST
MUTABILITY_VAR
public
mixed
MUTABILITY_VAR
= WASM_VAR
Methods
__construct()
Create a Wasm\Type\GlobalType from a `wasm_globaltype_t` resource.
public
__construct( $globaltype) : mixed
Parameters
Tags
Return values
mixed —asExternType()
public
asExternType() : ExternType
Return values
ExternType —content()
public
content() : ValType
Return values
ValType —inner()
Return the inner global type resource.
public
inner() : resource
Return values
resource —A wasm_globaltype_t
resource
mutability()
Return the global type's mutability.
public
mutability() : int
Return values
int —new()
public
static new(ValType $type[, int|null $mutability = null ]) : self
Parameters
- $type : ValType
- $mutability : int|null = null