ValType
Value types classify the individual values that WebAssembly code can compute with and the values that a variable accepts.
<?php declare(strict_types=1);
use Wasm\Type\ValType;
$valtype = Type\ValType::new(Type\ValType::KIND_I32);
Tags
Table of Contents
- KIND_ANYREF = WASM_ANYREF
- KIND_F32 = WASM_F32
- KIND_F64 = WASM_F64
- KIND_FUNCREF = WASM_FUNCREF
- KIND_I32 = WASM_I32
- KIND_I64 = WASM_I64
- __construct() : mixed
- Create a Wasm\Type\ValType from a `wasm_valtype_t` resource.
- inner() : resource
- Return the inner value type resource.
- isNum() : bool
- Check if the value type is a numeric type.
- isRef() : bool
- Check if the value type is a reference type.
- kind() : int
- Check the value type's type.
- new() : self
Constants
KIND_ANYREF
public
mixed
KIND_ANYREF
= WASM_ANYREF
KIND_F32
public
mixed
KIND_F32
= WASM_F32
KIND_F64
public
mixed
KIND_F64
= WASM_F64
KIND_FUNCREF
public
mixed
KIND_FUNCREF
= WASM_FUNCREF
KIND_I32
public
mixed
KIND_I32
= WASM_I32
KIND_I64
public
mixed
KIND_I64
= WASM_I64
Methods
__construct()
Create a Wasm\Type\ValType from a `wasm_valtype_t` resource.
public
__construct( $valtype) : mixed
Parameters
Tags
Return values
mixed —inner()
Return the inner value type resource.
public
inner() : resource
Return values
resource —A wasm_valtype_t
resource
isNum()
Check if the value type is a numeric type.
public
isNum() : bool
Return values
bool —isRef()
Check if the value type is a reference type.
public
isRef() : bool
Return values
bool —kind()
Check the value type's type.
public
kind() : int
Return values
int —new()
public
static new(int $kind) : self
Parameters
- $kind : int