Wasmer PHP

ExternType

Tags
todo

Fix doc & example

Function types classify the signature of functions, mapping a vector of parameters to a vector of results. They are also used to classify the inputs and outputs of instructions.

<?php declare(strict_types=1);

use Wasm\Type\ValType;

$valtype = Type\ValType::new(Type\ValType::KIND_I32);
see
https://webassembly.github.io/spec/core/syntax/types.html#function-types

WebAssembly Specification - Function Types

Table of Contents

KIND_FUNC  = WASM_EXTERN_FUNC
KIND_GLOBAL  = WASM_EXTERN_GLOBAL
KIND_MEMORY  = WASM_EXTERN_MEMORY
KIND_TABLE  = WASM_EXTERN_TABLE
__construct()  : mixed
Create a Wasm\Type\ExternType from a `wasm_externtype_t` resource.
asFuncType()  : FuncType
asGlobalType()  : GlobalType
inner()  : resource
Return the inner extern type resource.
kind()  : int

Constants

KIND_FUNC

public mixed KIND_FUNC = WASM_EXTERN_FUNC

KIND_GLOBAL

public mixed KIND_GLOBAL = WASM_EXTERN_GLOBAL

KIND_MEMORY

public mixed KIND_MEMORY = WASM_EXTERN_MEMORY

KIND_TABLE

public mixed KIND_TABLE = WASM_EXTERN_TABLE

Methods

__construct()

Create a Wasm\Type\ExternType from a `wasm_externtype_t` resource.

public __construct(mixed $externtype) : mixed
Parameters
$externtype : mixed
Tags
throws
InvalidArgumentException

If the $externtype argument is not a valid wasm_externtype_t resource

Return values
mixed

inner()

Return the inner extern type resource.

public inner() : resource
Return values
resource

A wasm_externtype_t resource

kind()

public kind() : int
Return values
int

Search results